Skip to content

Commit

Permalink
ci(workflows): add typescript-canary
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Apr 10, 2023
1 parent 4faf118 commit 0f220a8
Showing 1 changed file with 83 additions and 0 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/typescript-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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/v4.9.5/.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/debug-action@v2.1.0
- id: checkout
name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v3.5.0
with:
persist-credentials: false
ref: ${{ github.ref }}
- id: node
name: Setup Node.js
uses: actions/setup-node@v3.6.0
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: set-typescript-version
name: Set env.TYPESCRIPT_VERSION
run: |
echo "TYPESCRIPT_VERSION=$(jq .devDependencies.typescript package.json -r)" >>$GITHUB_ENV
- id: print-typescript-version
name: Print TypeScript version
run: echo $TYPESCRIPT_VERSION
- 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

0 comments on commit 0f220a8

Please sign in to comment.