| 1 | name: CI
|
|---|
| 2 |
|
|---|
| 3 | on:
|
|---|
| 4 | push:
|
|---|
| 5 | branches:
|
|---|
| 6 | - main
|
|---|
| 7 | - next
|
|---|
| 8 | - 'v*'
|
|---|
| 9 | paths-ignore:
|
|---|
| 10 | - 'docs/**'
|
|---|
| 11 | - '*.md'
|
|---|
| 12 | pull_request:
|
|---|
| 13 | paths-ignore:
|
|---|
| 14 | - 'docs/**'
|
|---|
| 15 | - '*.md'
|
|---|
| 16 |
|
|---|
| 17 | # This allows a subsequently queued workflow run to interrupt previous runs
|
|---|
| 18 | concurrency:
|
|---|
| 19 | group: "${{ github.workflow }}-${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
|
|---|
| 20 | cancel-in-progress: true
|
|---|
| 21 |
|
|---|
| 22 | permissions:
|
|---|
| 23 | contents: read
|
|---|
| 24 |
|
|---|
| 25 | jobs:
|
|---|
| 26 | test-regression-check-node10:
|
|---|
| 27 | name: Test compatibility with Node.js 10
|
|---|
| 28 | runs-on: ubuntu-latest
|
|---|
| 29 | permissions:
|
|---|
| 30 | contents: read
|
|---|
| 31 | steps:
|
|---|
| 32 | - uses: actions/checkout@v6
|
|---|
| 33 | with:
|
|---|
| 34 | persist-credentials: false
|
|---|
| 35 |
|
|---|
| 36 | - uses: actions/setup-node@v6
|
|---|
| 37 | with:
|
|---|
| 38 | node-version: '10'
|
|---|
| 39 | cache: 'npm'
|
|---|
| 40 | cache-dependency-path: package.json
|
|---|
| 41 | check-latest: true
|
|---|
| 42 |
|
|---|
| 43 | - name: Install
|
|---|
| 44 | run: |
|
|---|
| 45 | npm install --ignore-scripts
|
|---|
| 46 |
|
|---|
| 47 | - name: Copy project as fast-uri to node_node_modules
|
|---|
| 48 | run: |
|
|---|
| 49 | rm -rf ./node_modules/fast-uri/lib &&
|
|---|
| 50 | rm -rf ./node_modules/fast-uri/index.js &&
|
|---|
| 51 | cp -r ./lib ./node_modules/fast-uri/lib &&
|
|---|
| 52 | cp ./index.js ./node_modules/fast-uri/index.js
|
|---|
| 53 |
|
|---|
| 54 | - name: Run tests
|
|---|
| 55 | run: |
|
|---|
| 56 | npm run test:unit
|
|---|
| 57 | env:
|
|---|
| 58 | NODE_OPTIONS: no-network-family-autoselection
|
|---|
| 59 |
|
|---|
| 60 | test-browser:
|
|---|
| 61 | name: Test browser compatibility
|
|---|
| 62 | runs-on: ${{ matrix.os }}
|
|---|
| 63 | strategy:
|
|---|
| 64 | fail-fast: false
|
|---|
| 65 | matrix:
|
|---|
| 66 | os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
|
|---|
| 67 | browser: ['chromium', 'firefox', 'webkit']
|
|---|
| 68 | exclude:
|
|---|
| 69 | - os: ubuntu-latest
|
|---|
| 70 | browser: webkit
|
|---|
| 71 | permissions:
|
|---|
| 72 | contents: read
|
|---|
| 73 | steps:
|
|---|
| 74 | - uses: actions/checkout@v6
|
|---|
| 75 | with:
|
|---|
| 76 | persist-credentials: false
|
|---|
| 77 |
|
|---|
| 78 | - uses: actions/setup-node@v6
|
|---|
| 79 | with:
|
|---|
| 80 | node-version: '24'
|
|---|
| 81 | cache: 'npm'
|
|---|
| 82 | cache-dependency-path: package.json
|
|---|
| 83 | check-latest: true
|
|---|
| 84 |
|
|---|
| 85 | - name: Install dependencies
|
|---|
| 86 | run: |
|
|---|
| 87 | npm install --ignore-scripts
|
|---|
| 88 |
|
|---|
| 89 | - if: ${{ matrix.os == 'windows-latest' }}
|
|---|
| 90 | run: npx playwright install winldd
|
|---|
| 91 |
|
|---|
| 92 | - name: Run browser tests
|
|---|
| 93 | run: |
|
|---|
| 94 | npm run test:browser:${{ matrix.browser }}
|
|---|
| 95 |
|
|---|
| 96 | test:
|
|---|
| 97 | needs:
|
|---|
| 98 | - test-regression-check-node10
|
|---|
| 99 | permissions:
|
|---|
| 100 | contents: write
|
|---|
| 101 | pull-requests: write
|
|---|
| 102 | uses: fastify/workflows/.github/workflows/plugins-ci.yml@v6
|
|---|
| 103 | with:
|
|---|
| 104 | license-check: true
|
|---|
| 105 | lint: true
|
|---|
| 106 | node-versions: '["16", "18", "20", "22", "24"]'
|
|---|