From 2b7af71b8a4735292a691fd215e91a28f63e669c Mon Sep 17 00:00:00 2001 From: Mark Erikson Date: Thu, 23 Nov 2023 14:06:16 -0500 Subject: [PATCH] Use actual attw CLI and handle Node18 + CRA4 --- .github/workflows/test.yaml | 42 +++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 66c1917715..318e816795 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -132,6 +132,28 @@ jobs: yarn test:typecheck yarn test:types + are-the-types-wrong: + name: Check package config with are-the-types-wrong + + needs: [build] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node: ['18.x'] + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - uses: actions/download-artifact@v3 + with: + name: package + path: . + + # Note: We currently expect "FalseCJS" failures for Node16 + `moduleResolution: "node16" + - name: Run are-the-types-wrong + run: npx @arethetypeswrong/cli ./package.tgz --format table --ignore-rules false-cjs + test-published-artifact: name: Test Published Artifact ${{ matrix.example }} @@ -141,16 +163,7 @@ jobs: fail-fast: false matrix: node: ['18.x'] - example: - [ - 'cra4', - 'cra5', - 'next', - 'vite', - 'node-standard', - 'node-esm', - 'are-the-types-wrong' - ] + example: ['cra4', 'cra5', 'next', 'vite', 'node-standard', 'node-esm'] steps: - name: Checkout repo uses: actions/checkout@v2 @@ -190,15 +203,8 @@ jobs: - name: Build example working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Run test step working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} run: yarn test - if: matrix.example != 'are-the-types-wrong' - - - name: Run test step - working-directory: ./redux-toolkit/examples/publish-ci/${{ matrix.example }} - # Ignore "FalseCJS" errors in the `attw` job - run: yarn test -n FalseCJS - if: matrix.example == 'are-the-types-wrong'