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