mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
5f229d2d1f
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
285 lines
8.5 KiB
YAML
285 lines
8.5 KiB
YAML
name: Continuous integration
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build-and-run-vitest:
|
|
name: Build and run vitest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: 26.x
|
|
registry-url: 'https://registry.npmjs.org'
|
|
package-manager-cache: false
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --ignore-scripts
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
|
|
- name: Build project
|
|
run: npm run build
|
|
|
|
- name: Install Playwright with deps
|
|
run: npx playwright install --with-deps
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:vitest:unit
|
|
|
|
- name: Run browser tests
|
|
run: npm run test:vitest:browser:headless
|
|
|
|
- name: Pack npm tarball
|
|
run: npm pack
|
|
|
|
- name: Dependency Review
|
|
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
|
|
|
- name: Upload npm pack artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: axios-*.tgz
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
|
|
cjs-smoke-tests:
|
|
name: CJS smoke 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
package-manager-cache: false
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Install CJS smoke test dependencies
|
|
working-directory: tests/smoke/cjs
|
|
run: npm install --ignore-scripts
|
|
|
|
- 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
|
|
|
|
esm-smoke-tests:
|
|
name: ESM smoke tests (Node ${{ matrix.node-version }})
|
|
needs: build-and-run-vitest
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
node-version: [20, 22, 24, 26]
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
package-manager-cache: false
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Install ESM smoke test dependencies
|
|
working-directory: tests/smoke/esm
|
|
run: npm install --ignore-scripts
|
|
|
|
- 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
package-manager-cache: false
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Install CJS module test dependencies
|
|
working-directory: tests/module/cjs
|
|
run: npm install --ignore-scripts
|
|
|
|
- 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, 26]
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup node
|
|
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
registry-url: 'https://registry.npmjs.org'
|
|
package-manager-cache: false
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Install ESM module test dependencies
|
|
working-directory: tests/module/esm
|
|
run: npm install --ignore-scripts
|
|
|
|
- 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
|
|
|
|
bun-smoke-tests:
|
|
name: Bun smoke tests
|
|
needs: build-and-run-vitest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
no-cache: true
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Install packed axios
|
|
env:
|
|
TMPDIR: ${{ runner.temp }}
|
|
BUN_INSTALL_CACHE_DIR: ${{ runner.temp }}/bun-cache
|
|
run: |
|
|
mkdir -p "$BUN_INSTALL_CACHE_DIR"
|
|
mv artifacts/axios-*.tgz artifacts/axios.tgz
|
|
cd tests/smoke/bun
|
|
bun add file:../../../artifacts/axios.tgz
|
|
|
|
- name: Run Bun smoke tests
|
|
working-directory: tests/smoke/bun
|
|
run: bun test
|
|
|
|
deno-smoke-tests:
|
|
name: Deno smoke tests
|
|
needs: build-and-run-vitest
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup deno
|
|
uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4
|
|
with:
|
|
cache: false
|
|
|
|
- name: Download npm pack artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: axios-tarball
|
|
path: artifacts
|
|
|
|
- name: Prepare packed axios dist
|
|
run: mkdir -p dist && tar -xzf artifacts/axios-*.tgz -C artifacts && cp -R artifacts/package/dist/. ./dist
|
|
|
|
- name: Install Deno smoke test dependencies
|
|
working-directory: tests/smoke/deno
|
|
run: deno install
|
|
|
|
- name: Run Deno smoke tests
|
|
working-directory: tests/smoke/deno
|
|
run: deno task test
|