diff --git a/.github/workflows/test-and-release.yml b/.github/workflows/test-and-release.yml index 80002e79328..836cf2683b9 100644 --- a/.github/workflows/test-and-release.yml +++ b/.github/workflows/test-and-release.yml @@ -174,6 +174,15 @@ jobs: - name: Compile TypeScript code run: yarn run build + # Test that the generated packages are ok + - if: matrix.node-version == '10.x' + name: Import main entry point (CommonJS) + run: node -e 'require("./packages/zwave-js")' + + - if: matrix.node-version != '10.x' + name: Import main entry point (ESM) + run: node --input-type=module -e 'import "./packages/zwave-js"' + - name: Run component tests run: yarn run test:ci env: @@ -181,49 +190,6 @@ jobs: # =================== - # Test that the generated packages are ok - test-package: - if: contains(github.event.head_commit.message, '[skip ci]') == false - - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [14.x] - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - - name: Get Yarn cache directory - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: Use Yarn cache - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install dependencies - run: yarn install --prefer-offline --frozen-lockfile - - # Do a full build so the package files are regenerated - - name: Compile TypeScript code - run: yarn run build - - - name: Import main entry point - run: node -e 'require("./packages/zwave-js")' - - # =================== - # Generate coverage reports when the unit tests have succeeded coverage: # Trigger this step only on pushes, because the job often fails for pull requests @@ -287,7 +253,7 @@ jobs: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - needs: [lint, lint-zwave, unit-tests, test-package] + needs: [lint, lint-zwave, unit-tests] runs-on: ubuntu-latest strategy: