ci.yml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. permissions:
  16. contents: read
  17. jobs:
  18. test-regression-check-node10:
  19. name: Test compatibility with Node.js 10
  20. runs-on: ubuntu-latest
  21. permissions:
  22. contents: read
  23. steps:
  24. - uses: actions/checkout@v4
  25. with:
  26. persist-credentials: false
  27. - uses: actions/setup-node@v4
  28. with:
  29. node-version: '10'
  30. cache: 'npm'
  31. cache-dependency-path: package.json
  32. check-latest: true
  33. - name: Install
  34. run: |
  35. npm install --ignore-scripts
  36. - name: Copy project as fast-uri to node_node_modules
  37. run: |
  38. rm -rf ./node_modules/fast-uri/lib &&
  39. rm -rf ./node_modules/fast-uri/index.js &&
  40. cp -r ./lib ./node_modules/fast-uri/lib &&
  41. cp ./index.js ./node_modules/fast-uri/index.js
  42. - name: Run tests
  43. run: |
  44. npm run test:unit
  45. env:
  46. NODE_OPTIONS: no-network-family-autoselection
  47. test-browser:
  48. name: Test browser compatibility
  49. runs-on: ${{ matrix.os }}
  50. strategy:
  51. fail-fast: false
  52. matrix:
  53. os: ['ubuntu-latest', 'windows-latest', 'macos-latest']
  54. browser: ['chromium', 'firefox', 'webkit']
  55. exclude:
  56. - os: ubuntu-latest
  57. browser: webkit
  58. permissions:
  59. contents: read
  60. steps:
  61. - uses: actions/checkout@v4
  62. with:
  63. persist-credentials: false
  64. - uses: actions/setup-node@v4
  65. with:
  66. node-version: '24'
  67. cache: 'npm'
  68. cache-dependency-path: package.json
  69. check-latest: true
  70. - name: Install dependencies
  71. run: |
  72. npm install --ignore-scripts
  73. - if: ${{ matrix.os == 'windows-latest' }}
  74. run: npx playwright install winldd
  75. - name: Run browser tests
  76. run: |
  77. npm run test:browser:${{ matrix.browser }}
  78. test:
  79. needs:
  80. - test-regression-check-node10
  81. permissions:
  82. contents: write
  83. pull-requests: write
  84. uses: fastify/workflows/.github/workflows/plugins-ci.yml@v5
  85. with:
  86. license-check: true
  87. lint: true
  88. node-versions: '["16", "18", "20", "22", "24"]'