axios-axios/.github/workflows/run-ci.yml
Jay d905b7598d
refactor: refresh test suite to be modernised (#7489)
* chore: port karma tests

* chore: port karma tests

* chore: port karma tests

* chore: tests

* chore: tests

* chore: tests

* chore: fix issues with port collisions

* refactor: utils tests

* refactor: utils tests

* refactor: utils tests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: tests to vitests

* refactor: ci

* chore: install pw deps

* chore: fixx ai feedback

* chore: wip compatability tests

* chore: wip compatability tests

* chore: wip compatability tests

* refactor: wip smoke

* chore: smoke test run

* chore: update unzip

* chore: update testing

* chore: update testing

* chore: update testing

* chore: update testing

* chore: update testing

* chore: skip tests that cannot run on node 16 and lower

* chore: fix 16x under tests

* chore: rest of tests

* fix: functions and runs

* feat: added tests for esm smoke

* feat: added smoke

* chore: ignore ai gen plans

* chore: ci fixes

* chore: fix small p2s
2026-03-12 15:27:09 +02:00

113 lines
3.1 KiB
YAML

name: Continuous integration
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
security-events: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
persist-credentials: true
- name: Setup node
uses: actions/setup-node@v6
with:
node-version: 24.x
cache: npm
- name: Install dependencies
run: npm ci
- 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: Dependency Review
uses: actions/dependency-review-action@v4
- name: Upload build artifact
uses: actions/upload-artifact@v7
with:
name: axios
path: dist
retention-days: 1
cjs-smoke-tests:
name: CJS smoke tests (Node ${{ matrix.node-version }})
needs: ci
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/smoke/cjs/package-lock.json
- name: Install dependencies
if: matrix.node-version == 16 || matrix.node-version == 18
run: npm ci
- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: axios
path: dist
- name: Install CJS smoke test dependencies
working-directory: tests/smoke/cjs
run: npm install
- 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: ci
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/smoke/esm/package-lock.json
- name: Install dependencies
run: npm ci
- name: Download build artifact
uses: actions/download-artifact@v8
with:
name: axios
path: dist
- name: Install ESM smoke test dependencies
working-directory: tests/smoke/esm
run: npm install
- name: Run ESM smoke tests
working-directory: tests/smoke/esm
run: npm run test:smoke:esm:vitest