ci.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. name: CI
  2. on:
  3. push:
  4. branches: [master, next]
  5. pull_request:
  6. branches: [master, next]
  7. permissions:
  8. contents: read
  9. jobs:
  10. build:
  11. runs-on: ubuntu-latest
  12. timeout-minutes: 15
  13. strategy:
  14. matrix:
  15. node-version: [20]
  16. steps:
  17. - uses: actions/checkout@v3
  18. - uses: pnpm/action-setup@v3
  19. with:
  20. version: ^8.15.0
  21. - name: Use Node.js ${{ matrix.node-version }}
  22. uses: actions/setup-node@v3
  23. with:
  24. node-version: ${{ matrix.node-version }}
  25. cache: 'pnpm'
  26. # Cargo already skips downloading dependencies if they already exist
  27. - name: Cache cargo
  28. uses: actions/cache@v3
  29. with:
  30. path: |
  31. ~/.cargo/bin/
  32. ~/.cargo/registry/index/
  33. ~/.cargo/registry/cache/
  34. ~/.cargo/git/db/
  35. target/
  36. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
  37. # Cache the `oxide` Rust build
  38. - name: Cache oxide build
  39. uses: actions/cache@v3
  40. with:
  41. path: |
  42. ./target/
  43. ./crates/node/*.node
  44. ./crates/node/index.js
  45. ./crates/node/index.d.ts
  46. key: ${{ runner.os }}-oxide-${{ hashFiles('./crates/**/*') }}
  47. - name: Install dependencies
  48. run: pnpm install
  49. - name: Build
  50. run: pnpm run build
  51. - name: Lint
  52. run: pnpm run lint
  53. - name: Test
  54. run: pnpm run test
  55. - name: Install Playwright Browsers
  56. run: npx playwright install --with-deps
  57. - name: Run Playwright tests
  58. run: npm run test:ui
  59. - uses: actions/upload-artifact@v3
  60. if: always()
  61. with:
  62. name: playwright-report
  63. path: packages/tailwindcss/playwright-report/
  64. retention-days: 30
  65. - name: Bench
  66. run: pnpm run bench