|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "*" |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - "*" |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read |
| 17 | + |
| 18 | +jobs: |
| 19 | + commit: |
| 20 | + name: Commit check |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + steps: |
| 23 | + - name: Harden runner |
| 24 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 25 | + with: |
| 26 | + disable-sudo: true |
| 27 | + egress-policy: block |
| 28 | + allowed-endpoints: > |
| 29 | + bun.sh:443 |
| 30 | + github.com:443 |
| 31 | + objects.githubusercontent.com:443 |
| 32 | + registry.npmjs.org:443 |
| 33 | +
|
| 34 | + - name: Git checkout |
| 35 | + if: github.event_name == 'push' |
| 36 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 37 | + with: |
| 38 | + fetch-depth: 1 |
| 39 | + sparse-checkout: | |
| 40 | + . |
| 41 | + src |
| 42 | + persist-credentials: false |
| 43 | + |
| 44 | + - name: Git checkout (full-history) |
| 45 | + if: github.event_name == 'pull_request' |
| 46 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 47 | + with: |
| 48 | + fetch-depth: 0 |
| 49 | + sparse-checkout: | |
| 50 | + . |
| 51 | + src |
| 52 | + ref: ${{ github.head_ref }} |
| 53 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 54 | + persist-credentials: false |
| 55 | + |
| 56 | + - name: Set up bun@latest |
| 57 | + uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 |
| 58 | + |
| 59 | + - name: Install dependencies |
| 60 | + run: bun ci |
| 61 | + |
| 62 | + - name: Run check (push) |
| 63 | + if: github.event_name == 'push' |
| 64 | + run: bunx --bun commitlint --last --verbose |
| 65 | + |
| 66 | + - name: Run check (pull_request) |
| 67 | + if: github.event_name == 'pull_request' |
| 68 | + run: bunx --bun commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |
| 69 | + |
| 70 | + dependency: |
| 71 | + name: Dependency check |
| 72 | + runs-on: ubuntu-24.04 |
| 73 | + permissions: |
| 74 | + pull-requests: write |
| 75 | + steps: |
| 76 | + - name: Harden runner |
| 77 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 78 | + with: |
| 79 | + disable-sudo: true |
| 80 | + egress-policy: block |
| 81 | + allowed-endpoints: > |
| 82 | + api.github.com:443 |
| 83 | + api.securityscorecards.dev:443 |
| 84 | + github.com:443 |
| 85 | +
|
| 86 | + - name: Git checkout |
| 87 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 88 | + with: |
| 89 | + fetch-depth: ${{ github.event_name == 'pull_request' && 1 || 2 }} |
| 90 | + repository: ${{ github.event.pull_request.head.repo.full_name }} |
| 91 | + persist-credentials: false |
| 92 | + |
| 93 | + - name: Run check (push) |
| 94 | + if: github.event_name == 'push' |
| 95 | + uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 #v4.5.0 |
| 96 | + with: |
| 97 | + allow-licenses: MIT, ISC, CC0-1.0, Apache-2.0, BSD-3-Clause, Unlicense |
| 98 | + head-ref: ${{ github.sha }} |
| 99 | + base-ref: ${{ github.event.before }} |
| 100 | + fail-on-severity: low |
| 101 | + comment-summary-in-pr: never |
| 102 | + warn-on-openssf-scorecard-level: 3 |
| 103 | + |
| 104 | + - name: Run check (pull_request) |
| 105 | + if: github.event_name == 'pull_request' |
| 106 | + uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 #v4.5.0 |
| 107 | + with: |
| 108 | + allow-licenses: MIT, ISC, CC0-1.0, Apache-2.0, BSD-3-Clause, Unlicense |
| 109 | + fail-on-severity: low |
| 110 | + comment-summary-in-pr: on-failure |
| 111 | + warn-on-openssf-scorecard-level: 3 |
| 112 | + |
| 113 | + format: |
| 114 | + name: Format check |
| 115 | + runs-on: ubuntu-24.04 |
| 116 | + steps: |
| 117 | + - name: Harden runner |
| 118 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 119 | + with: |
| 120 | + disable-sudo: true |
| 121 | + egress-policy: block |
| 122 | + allowed-endpoints: > |
| 123 | + bun.sh:443 |
| 124 | + github.com:443 |
| 125 | + objects.githubusercontent.com:443 |
| 126 | + github.com:443 |
| 127 | + registry.npmjs.org:443 |
| 128 | +
|
| 129 | + - name: Git checkout |
| 130 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 131 | + with: |
| 132 | + persist-credentials: false |
| 133 | + |
| 134 | + - name: Set up bun@latest |
| 135 | + uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 |
| 136 | + |
| 137 | + - name: Install dependencies |
| 138 | + run: bun ci |
| 139 | + |
| 140 | + - name: Run check |
| 141 | + run: bunx biome ci --reporter=github --max-diagnostics=none --no-errors-on-unmatched |
| 142 | + |
| 143 | + spec: |
| 144 | + name: Spec check |
| 145 | + runs-on: ubuntu-24.04 |
| 146 | + steps: |
| 147 | + - name: Harden runner |
| 148 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 149 | + with: |
| 150 | + disable-sudo: true |
| 151 | + egress-policy: block |
| 152 | + allowed-endpoints: > |
| 153 | + bun.sh:443 |
| 154 | + cli.codecov.io:443 |
| 155 | + github.com:443 |
| 156 | + ingest.codecov.io:443 |
| 157 | + keybase.io:443 |
| 158 | + objects.githubusercontent.com:443 |
| 159 | + registry.npmjs.org:443 |
| 160 | + storage.googleapis.com:443 |
| 161 | +
|
| 162 | + - name: Git checkout |
| 163 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 164 | + with: |
| 165 | + persist-credentials: false |
| 166 | + |
| 167 | + - name: Set up bun@latest |
| 168 | + uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 |
| 169 | + |
| 170 | + - name: Install dependencies |
| 171 | + run: bun ci |
| 172 | + |
| 173 | + - name: Run check |
| 174 | + env: |
| 175 | + FORCE_COLOR: 3 |
| 176 | + run: bun test --coverage --coverage-reporter=lcov --coverage-reporter=text --reporter=junit --reporter-outfile=junit.xml |
| 177 | + |
| 178 | + - name: Upload lcov |
| 179 | + uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1 |
| 180 | + with: |
| 181 | + fail_ci_if_error: true |
| 182 | + |
| 183 | + - name: Upload test result |
| 184 | + uses: codecov/test-results-action@4e79e65778be1cecd5df25e14af1eafb6df80ea9 # v1.0.2 |
| 185 | + with: |
| 186 | + fail_ci_if_error: true |
| 187 | + |
| 188 | + type: |
| 189 | + name: Type check |
| 190 | + runs-on: ubuntu-24.04 |
| 191 | + steps: |
| 192 | + - name: Harden runner |
| 193 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 194 | + with: |
| 195 | + disable-sudo: true |
| 196 | + egress-policy: block |
| 197 | + allowed-endpoints: > |
| 198 | + api.github.com:443 |
| 199 | + bun.sh:443 |
| 200 | + github.com:443 |
| 201 | + objects.githubusercontent.com:443 |
| 202 | + github.com:443 |
| 203 | + registry.npmjs.org:443 |
| 204 | +
|
| 205 | + - name: Git checkout |
| 206 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 207 | + with: |
| 208 | + persist-credentials: false |
| 209 | + |
| 210 | + - name: Set up bun@latest |
| 211 | + uses: oven-sh/setup-bun@4bc047ad259df6fc24a6c9b0f9a0cb08cf17fbe5 # v2.0.1 |
| 212 | + |
| 213 | + - name: Install dependencies |
| 214 | + run: bun ci |
| 215 | + |
| 216 | + - name: Run check |
| 217 | + run: | |
| 218 | + bunx tsc |
| 219 | + bunx type-coverage |
0 commit comments