|
| 1 | +name: Node tests |
| 2 | + |
| 3 | +on: pull_request |
| 4 | + |
| 5 | +env: |
| 6 | + FORCE_COLOR: true |
| 7 | + |
| 8 | +jobs: |
| 9 | + verify-linux: |
| 10 | + timeout-minutes: 30 |
| 11 | + name: Linux |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: |
| 16 | + - '18' |
| 17 | + - '20' |
| 18 | + - 'latest' |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v4 |
| 22 | + |
| 23 | + - name: Setup Node ${{ matrix.node-version }} |
| 24 | + uses: actions/setup-node@v4 |
| 25 | + env: |
| 26 | + FORCE_COLOR: 0 |
| 27 | + with: |
| 28 | + node-version: ${{ matrix.node-version }} |
| 29 | + cache: npm |
| 30 | + |
| 31 | + - name: Install Playwright dependencies |
| 32 | + run: npx playwright install --with-deps |
| 33 | + |
| 34 | + # Set up GitHub Actions caching for Wireit. |
| 35 | + - uses: google/wireit@setup-github-actions-caching/v1 |
| 36 | + |
| 37 | + - name: Install Dependencies |
| 38 | + run: npm ci |
| 39 | + |
| 40 | + - name: Build packages |
| 41 | + run: npm run build |
| 42 | + |
| 43 | + - name: Build types for js packages |
| 44 | + run: npm run types |
| 45 | + |
| 46 | + # build for production in CI to make sure tests can run with production build |
| 47 | + - name: Build specific packages for production |
| 48 | + run: npm run build:production |
| 49 | + |
| 50 | + - name: Test |
| 51 | + run: npm run test:node |
| 52 | + |
| 53 | + verify-windows: |
| 54 | + timeout-minutes: 30 |
| 55 | + name: Windows |
| 56 | + runs-on: windows-2022 |
| 57 | + steps: |
| 58 | + - name: Set git to use LF |
| 59 | + run: | |
| 60 | + git config --global core.autocrlf false |
| 61 | + git config --global core.eol lf |
| 62 | +
|
| 63 | + - uses: actions/checkout@v4 |
| 64 | + |
| 65 | + - name: Setup Node '20' |
| 66 | + uses: actions/setup-node@v4 |
| 67 | + env: |
| 68 | + FORCE_COLOR: 0 |
| 69 | + with: |
| 70 | + node-version: '20' |
| 71 | + cache: 'npm' |
| 72 | + |
| 73 | + - name: Install Playwright dependencies |
| 74 | + run: npx playwright install --with-deps |
| 75 | + |
| 76 | + # Set up GitHub Actions caching for Wireit. |
| 77 | + - uses: google/wireit@setup-github-actions-caching/v1 |
| 78 | + |
| 79 | + - name: Install Dependencies |
| 80 | + run: npm ci |
| 81 | + |
| 82 | + - name: Build |
| 83 | + run: npm run build |
| 84 | + |
| 85 | + # build for production in CI to make sure tests can run with production build |
| 86 | + - name: Build specific packages for production |
| 87 | + run: npm run build:production |
| 88 | + |
| 89 | + - name: Test |
| 90 | + run: npm run test:node |
0 commit comments