-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (78 loc) · 2.67 KB
/
typescript-canary.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# TypeScript Canary Check
#
# Run type tests against the latest and next versions of TypeScript.
#
# References:
#
# - https://docs.github.com/actions/learn-github-actions/contexts
# - https://docs.github.com/actions/using-jobs/using-a-matrix-for-your-jobs
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#schedule
# - https://docs.github.com/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch
# - https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions
# - https://docs.github.com/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_dispatch
# - https://github.com/actions/checkout
# - https://github.com/actions/setup-node
# - https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#yarn2-configuration
# - https://github.com/hmarr/debug-action
# - https://vitest.dev/guide/testing-types.html#run-typechecking
---
name: typescript-canary
on:
schedule:
# every day, 3 hours after typescript@next release
# https://github.com/microsoft/TypeScript/blob/v5.0.4/.github/workflows/nightly.yaml
- cron: 0 10 * * *
workflow_dispatch:
permissions:
contents: read
packages: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HUSKY: 0
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
typescript-canary:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
typescript-version:
- next
- latest
steps:
- id: debug
name: Print environment variables and event payload
uses: hmarr/[email protected]
- id: checkout
name: Checkout ${{ github.ref_name }}
uses: actions/[email protected]
with:
persist-credentials: false
ref: ${{ github.ref }}
- id: node
name: Setup Node.js
uses: actions/[email protected]
with:
cache: yarn
cache-dependency-path: yarn.lock
node-version-file: .nvmrc
- id: yarn
name: Install dependencies
run: yarn ${{ github.actor == 'dependabot[bot]' && '--no-immutable' || '--immutable' }}
- id: typescript
name: Install typescript@${{ matrix.typescript-version }}
run: yarn add -D typescript@${{ matrix.typescript-version }}
- id: print-typescript-version
name: Print TypeScript version
run: jq .devDependencies.typescript package.json -r
- id: build
name: Build project
run: yarn build
- id: typecheck
name: Run typecheck
run: yarn typecheck
- id: typecheck-build
name: Run typecheck-build
run: yarn check:types:build