diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c20a33eb655..67c6864ebc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,40 @@ jobs: - name: linting run: yarn lint + types: + name: Type Checking (current version) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 12.x + cache: yarn + - name: install dependencies + run: yarn install --frozen-lockfile --non-interactive + - name: Check types + run: yarn type-check + + types-range: + name: Type Checking (other supported versions) + runs-on: ubuntu-latest + needs: ['types'] + strategy: + matrix: + ts-version: ['next'] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 12.x + cache: yarn + - name: install dependencies + run: yarn install --frozen-lockfile --non-interactive + - name: install TS@${{matrix.ts-version}} + run: yarn add -D typescript@${{ matrix.ts-version }} + - name: Check types with TS@${{matrix.ts-version}} + run: yarn type-check + basic-test: name: Debug and Prebuilt (All Tests by Package + Canary Features) runs-on: ubuntu-latest @@ -61,7 +95,7 @@ jobs: browserstack-test: name: Browserstack Tests (Safari, Edge) runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -87,7 +121,7 @@ jobs: smoke-test: name: Smoke tests (Full Ember Apps) runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v2 @@ -110,7 +144,7 @@ jobs: production-test: name: Production (All Tests + Canary Features) runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -130,7 +164,7 @@ jobs: production-debug-render-test: name: Production (All Tests + Canary Features with Debug Render Tree) runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -151,7 +185,7 @@ jobs: extend-prototypes-test: name: Extend Prototypes runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -172,7 +206,7 @@ jobs: node-test: name: Node.js Tests runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -212,7 +246,7 @@ jobs: browser-test: name: Browser Tests (Firefox) runs-on: ubuntu-latest - needs: [basic-test, lint] + needs: [basic-test, lint, types] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 @@ -236,7 +270,18 @@ jobs: deploy-tag: name: Deploy tags to npm runs-on: ubuntu-latest - needs: [basic-test, lint, browserstack-test, production-test, production-debug-render-test, extend-prototypes-test, node-test, blueprint-test, browser-test] + needs: + [ + basic-test, + lint, + browserstack-test, + production-test, + production-debug-render-test, + extend-prototypes-test, + node-test, + blueprint-test, + browser-test, + ] if: startsWith(github.ref, 'refs/tags/v') steps: - uses: actions/checkout@v3 @@ -257,7 +302,18 @@ jobs: publish: name: Publish channel to s3 runs-on: ubuntu-latest - needs: [basic-test, lint, browserstack-test, production-test, production-debug-render-test, extend-prototypes-test, node-test, blueprint-test, browser-test] + needs: + [ + basic-test, + lint, + browserstack-test, + production-test, + production-debug-render-test, + extend-prototypes-test, + node-test, + blueprint-test, + browser-test, + ] # Only run on pushes to branches that are not from the cron workflow if: github.event_name == 'push' && contains(github.ref, 'cron') != true steps: @@ -280,7 +336,18 @@ jobs: publish-alpha: name: Publish alpha from default branch runs-on: ubuntu-latest - needs: [basic-test, lint, browserstack-test, production-test, production-debug-render-test, extend-prototypes-test, node-test, blueprint-test, browser-test] + needs: + [ + basic-test, + lint, + browserstack-test, + production-test, + production-debug-render-test, + extend-prototypes-test, + node-test, + blueprint-test, + browser-test, + ] # Only run on pushes to master if: github.event_name == 'push' && github.ref == 'refs/heads/master' steps: @@ -301,4 +368,3 @@ jobs: S3_BUCKET_NAME: 'builds.emberjs.com' S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY}} S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID}} - diff --git a/.github/workflows/night-ts.yml b/.github/workflows/night-ts.yml new file mode 100644 index 00000000000..c3b5f3cea45 --- /dev/null +++ b/.github/workflows/night-ts.yml @@ -0,0 +1,18 @@ +name: Nightly TypeScript Run + +jobs: + ts-next: + name: typescript@next + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: volta-cli/action@v1 + - run: yarn install --frozen-lockfile --non-interactive + - run: yarn add -D typescript@next + - run: yarn type-check + +# ...nightly at midnight +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: diff --git a/package.json b/package.json index 9bbfd57496f..293b8e2d78a 100644 --- a/package.json +++ b/package.json @@ -41,16 +41,16 @@ "lint:docs": "qunit tests/docs/coverage-test.js", "lint:eslint": "eslint --report-unused-disable-directives --cache .", "lint:eslint:fix": "npm-run-all \"lint:eslint --fix\"", - "lint:tsc:stable": "tsc --noEmit", - "lint:tsc:preview": "tsc --noEmit --project type-tests/preview", - "lint:tsc": "npm-run-all lint:tsc:*", "lint:fix": "npm-run-all lint:*:fix", "test": "node bin/run-tests.js", "test:blueprints:js": "mocha node-tests/blueprints/**/*-test.js", "test:blueprints:ts": "EMBER_TYPESCRIPT_BLUEPRINTS=true yarn test:blueprints:js", "test:blueprints": "yarn test:blueprints:js && yarn test:blueprints:ts", "test:node": "qunit tests/node/**/*-test.js", - "test:browserstack": "node bin/run-browserstack-tests.js" + "test:browserstack": "node bin/run-browserstack-tests.js", + "type-check:stable": "tsc --noEmit", + "type-check:preview": "tsc --noEmit --project type-tests/preview", + "type-check": "npm-run-all type-check:*" }, "dependencies": { "@babel/helper-module-imports": "^7.16.7",