diff --git a/.github/workflows/release-branch.yml b/.github/workflows/release-branch.yml index fee76836..29a8502c 100644 --- a/.github/workflows/release-branch.yml +++ b/.github/workflows/release-branch.yml @@ -44,11 +44,14 @@ jobs: run: npm run test:vitest:unit - name: Run browser tests run: npm run test:vitest:browser:headless - - name: Upload build artifact + - name: Pack npm tarball + run: npm pack + - name: Upload npm pack artifact uses: actions/upload-artifact@v7 with: - name: axios - path: dist + name: axios-tarball + path: axios-*.tgz + if-no-files-found: error retention-days: 1 cjs-smoke-tests: @@ -70,17 +73,17 @@ jobs: node-version: ${{ matrix.node-version }} cache: npm cache-dependency-path: tests/smoke/cjs/package-lock.json - - name: Install dependencies - if: matrix.node-version == 16 || matrix.node-version == 18 - run: npm ci - - name: Download build artifact + - name: Download npm pack artifact uses: actions/download-artifact@v8 with: - name: axios - path: dist + name: axios-tarball + path: artifacts - name: Install CJS smoke test dependencies working-directory: tests/smoke/cjs run: npm install + - name: Install packed axios + working-directory: tests/smoke/cjs + run: npm install --no-save ../../../artifacts/axios-*.tgz - name: Run CJS smoke tests working-directory: tests/smoke/cjs run: npm run test:smoke:cjs:mocha @@ -104,20 +107,89 @@ jobs: node-version: ${{ matrix.node-version }} cache: npm cache-dependency-path: tests/smoke/esm/package-lock.json - - name: Install dependencies - run: npm ci - - name: Download build artifact + - name: Download npm pack artifact uses: actions/download-artifact@v8 with: - name: axios - path: dist + name: axios-tarball + path: artifacts - name: Install ESM smoke test dependencies working-directory: tests/smoke/esm run: npm install + - name: Install packed axios + working-directory: tests/smoke/esm + run: npm install --no-save ../../../artifacts/axios-*.tgz - name: Run ESM smoke tests working-directory: tests/smoke/esm run: npm run test:smoke:esm:vitest + cjs-module-tests: + name: CJS module tests (Node ${{ matrix.node-version }}) + needs: build-and-run-vitest + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [12, 14, 16, 18] + steps: + - name: Checkout repo + uses: actions/checkout@v6 + with: + persist-credentials: true + - name: Setup node + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: tests/module/cjs/package-lock.json + - name: Download npm pack artifact + uses: actions/download-artifact@v8 + with: + name: axios-tarball + path: artifacts + - name: Install CJS module test dependencies + working-directory: tests/module/cjs + run: npm install + - name: Install packed axios + working-directory: tests/module/cjs + run: npm install --no-save ../../../artifacts/axios-*.tgz + - name: Run CJS module tests + working-directory: tests/module/cjs + run: npm run test:module:cjs + + esm-module-tests: + name: ESM module tests (Node ${{ matrix.node-version }}) + needs: build-and-run-vitest + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: [20, 22, 24] + steps: + - name: Checkout repo + uses: actions/checkout@v6 + with: + persist-credentials: true + - name: Setup node + uses: actions/setup-node@v6 + with: + node-version: ${{ matrix.node-version }} + cache: npm + cache-dependency-path: tests/module/esm/package-lock.json + - name: Download npm pack artifact + uses: actions/download-artifact@v8 + with: + name: axios-tarball + path: artifacts + - name: Install ESM module test dependencies + working-directory: tests/module/esm + run: npm install + - name: Install packed axios + working-directory: tests/module/esm + run: npm install --no-save ../../../artifacts/axios-*.tgz + - name: Run ESM module tests + working-directory: tests/module/esm + run: npm run test:module:esm + bump-version-and-create-pr: name: Bump version and create PR needs: [build-and-run-vitest, cjs-smoke-tests, esm-smoke-tests]