|
58 | 58 | runs-on: ubuntu-latest |
59 | 59 | outputs: |
60 | 60 | cache-key: ${{ steps.cache-key.outputs.result }} |
61 | | - version: ${{ steps.version.outputs.result }} |
| 61 | + typecheck-files: ${{ steps.typecheck-files.outputs.files_exists }} |
62 | 62 | version-typescript: ${{ steps.version-typescript.outputs.result }} |
| 63 | + version: ${{ steps.version.outputs.result }} |
63 | 64 | steps: |
64 | 65 | - id: debug |
65 | 66 | name: Print environment variables and event payload |
|
97 | 98 | - id: version-typescript |
98 | 99 | name: Get TypeScript version |
99 | 100 | run: echo "result=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_OUTPUT |
| 101 | + - id: typecheck-files |
| 102 | + name: Check for typecheck files |
| 103 | + |
| 104 | + with: |
| 105 | + files: 'src/**/__tests__/*.spec-d.mts' |
100 | 106 | commitlint: |
101 | 107 | needs: preflight |
102 | 108 | runs-on: ubuntu-latest |
@@ -130,23 +136,21 @@ jobs: |
130 | 136 | runs-on: ubuntu-latest |
131 | 137 | steps: |
132 | 138 | - id: checkout |
133 | | - name: Checkout ${{ env.REF_NAME }} |
| 139 | + name: Checkout |
134 | 140 | |
135 | 141 | with: |
136 | 142 | fetch-depth: 0 |
137 | | - persist-credentials: false |
138 | | - ref: ${{ env.REF }} |
139 | 143 | - id: scan |
140 | | - name: Scan commits for secrets and policy breaches |
141 | | - uses: GitGuardian/ggshield-action@master |
| 144 | + name: Scan commits with ggshield |
| 145 | + uses: GitGuardian/ggshield-action@v1.34.0 |
142 | 146 | env: |
143 | 147 | GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }} |
144 | 148 | GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} |
145 | 149 | GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }} |
146 | 150 | GITHUB_PUSH_BASE_SHA: ${{ github.event.base }} |
147 | 151 | GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }} |
148 | 152 | with: |
149 | | - args: --all-policies --show-secrets --verbose |
| 153 | + args: --all-policies --format sarif --show-secrets --with-incident-details --verbose |
150 | 154 | format: |
151 | 155 | needs: |
152 | 156 | - commitlint |
@@ -245,48 +249,45 @@ jobs: |
245 | 249 | matrix: |
246 | 250 | typescript-version: |
247 | 251 | - ${{ needs.preflight.outputs.version-typescript }} |
248 | | - - 5.4.5 |
249 | | - - 5.3.3 |
250 | | - - latest |
| 252 | + env: |
| 253 | + VITEST_REPORT: ./.vitest-reports/typecheck.blob.json |
| 254 | + if: ${{ fromJson(needs.preflight.outputs.typecheck-files) }} |
251 | 255 | steps: |
252 | 256 | - id: checkout |
253 | 257 | name: Checkout ${{ env.REF_NAME }} |
254 | 258 | |
255 | 259 | with: |
256 | 260 | persist-credentials: false |
257 | 261 | ref: ${{ env.REF }} |
258 | | - - id: test-files-check |
259 | | - name: Check for typecheck files |
260 | | - |
261 | | - with: |
262 | | - files: '**/__tests__/*.spec-d.ts' |
263 | 262 | - id: node |
264 | | - if: steps.test-files-check.outputs.files_exists == 'true' |
265 | 263 | name: Setup Node.js |
266 | 264 | |
267 | 265 | with: |
268 | 266 | cache: yarn |
269 | 267 | cache-dependency-path: yarn.lock |
270 | 268 | node-version-file: .nvmrc |
271 | 269 | - id: cache |
272 | | - if: steps.test-files-check.outputs.files_exists == 'true' |
273 | 270 | name: Restore dependencies cache |
274 | 271 | |
275 | 272 | with: |
276 | 273 | key: ${{ needs.preflight.outputs.cache-key }} |
277 | 274 | path: ${{ env.CACHE_PATH }} |
278 | 275 | - id: typescript |
279 | | - if: steps.test-files-check.outputs.files_exists == 'true' |
280 | 276 | name: Install typescript@${{ matrix.typescript-version }} |
281 | 277 | run: yarn add -D typescript@${{ matrix.typescript-version }} |
282 | 278 | - id: print-typescript-version |
283 | | - if: steps.test-files-check.outputs.files_exists == 'true' |
284 | 279 | name: Print TypeScript version |
285 | 280 | run: jq .devDependencies.typescript package.json -r |
286 | 281 | - id: typecheck |
287 | | - if: steps.test-files-check.outputs.files_exists == 'true' |
288 | 282 | name: Run typecheck |
289 | 283 | run: yarn typecheck |
| 284 | + - id: report |
| 285 | + name: Upload report |
| 286 | + |
| 287 | + with: |
| 288 | + name: | |
| 289 | + ${{ format('typecheck-{0}-{1}-{2}.blob.json', matrix.typescript-version, github.event.repository.name, env.SHA) }} |
| 290 | + path: ${{ env.VITEST_REPORT }} |
290 | 291 | build: |
291 | 292 | needs: |
292 | 293 | - commitlint |
@@ -345,6 +346,8 @@ jobs: |
345 | 346 | - spelling |
346 | 347 | - typescript |
347 | 348 | runs-on: ubuntu-latest |
| 349 | + env: |
| 350 | + NODE_NO_WARNINGS: 1 |
348 | 351 | steps: |
349 | 352 | - id: checkout |
350 | 353 | name: Checkout ${{ env.REF_NAME }} |
|
0 commit comments