From f993b9ef8a05b2e0df94bd05de0254a03689851c Mon Sep 17 00:00:00 2001 From: Chris Krycho Date: Thu, 5 May 2022 10:38:14 -0600 Subject: [PATCH] Add type tests to GitHub Actions config - This tests against the same minimum version as the existing type definitions on DefinitelyTyped, so users can upgrade to at least the version supported there, and then switch over to using this. Note that type tests do *not* use Ember Try, and therefore do not drift the lockfile. This is intentional: the emitted types here are wholly unaffected by the rest of the dependencies other than those in `@types`, and for compatibility with TS we only care about the types. This makes that part of CI run *much* faster. - The type tests allow failures against the `typescript@next` version, just as the runtime tests do for Ember Canary releases. --- .github/workflows/CI.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index fc4695d..a4a7be4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -76,3 +76,26 @@ jobs: run: yarn install --frozen-lockfile - name: Run Tests run: node_modules/.bin/ember try:one ${{ matrix.scenario }} --skip-cleanup + + types: + name: type tests + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ts-version: + - 4.4 + - 4.5 + - 4.6 + - next + + steps: + - uses: actions/checkout@v3 + - run: yarn install --frozen-lockfile --non-interactive + - run: yarn add -D typescript@${{ matrix.ts-version }} + - run: ./node_modules/.bin/tsc --project type-tests + - run: ./node_modules/.bin/tsc --project type-tests/with-registry + + continue-on-error: ${{ matrix.ts-version == 'next' }}