ci.yml 2.5 KB

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