|
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - build: |
14 | | - name: Build |
| 13 | + browser-macos: |
| 14 | + name: Test Browser on macOS |
15 | 15 | runs-on: macos-latest |
16 | 16 | env: |
17 | 17 | GITHUB_ACTIONS_OUTPUT: "" |
18 | 18 | strategy: |
19 | 19 | fail-fast: false |
20 | 20 | matrix: |
21 | | - browser: [chrome, firefox, jsc, safari, spidermonkey, v8] |
| 21 | + browser: [safari] |
| 22 | + suite: [default, disabled, main] |
22 | 23 | steps: |
23 | | - - name: Extract Week Number |
24 | | - run: echo "WEEK_NUMBER=$(date +%W)" >> $GITHUB_ENV |
25 | 24 |
|
26 | | - - name: Install Firefox |
27 | | - if: ${{ matrix.browser == 'firefox' }} |
28 | | - run: brew install --cask firefox |
29 | | - |
30 | | - - name: Checkout Branch |
31 | | - uses: actions/checkout@v4 |
| 25 | + - &checkout-branch |
| 26 | + name: Checkout Branch |
| 27 | + uses: actions/checkout@v5 |
32 | 28 |
|
33 | | - - name: Setup Node |
34 | | - uses: actions/setup-node@v4 |
| 29 | + - &setup-node |
| 30 | + name: Setup Node |
| 31 | + uses: actions/setup-node@v5 |
35 | 32 | with: |
36 | 33 | node-version-file: package.json |
37 | 34 | cache: npm |
38 | 35 |
|
39 | | - - name: Install Node Packages |
| 36 | + - &install-node-packages |
| 37 | + name: Install Node Packages |
40 | 38 | run: npm ci |
41 | 39 |
|
42 | | - - name: Decompress compressed files |
43 | | - run: npm run decompress |
| 40 | + - name: Run Tests |
| 41 | + run: | |
| 42 | + echo "Running in $BROWSER" |
| 43 | + npm run test:${{ matrix.browser }} -- ${{ matrix.suite }} |
| 44 | +
|
| 45 | + browser-linux: |
| 46 | + name: Test Browser on Linux |
| 47 | + runs-on: ubuntu-latest |
| 48 | + env: |
| 49 | + GITHUB_ACTIONS_OUTPUT: "" |
| 50 | + strategy: |
| 51 | + fail-fast: false |
| 52 | + matrix: |
| 53 | + browser: [chrome, firefox] |
| 54 | + suite: [default, disabled, main] |
| 55 | + steps: |
| 56 | + - *checkout-branch |
| 57 | + - *setup-node |
| 58 | + - *install-node-packages |
| 59 | + - name: Run Tests |
| 60 | + run: | |
| 61 | + echo "Running in $BROWSER" |
| 62 | + npm run test:${{ matrix.browser }} -- ${{ matrix.suite }} |
| 63 | + shell: |
| 64 | + name: Test Shell |
| 65 | + runs-on: ubuntu-latest |
| 66 | + env: |
| 67 | + GITHUB_ACTIONS_OUTPUT: "" |
| 68 | + strategy: |
| 69 | + fail-fast: false |
| 70 | + matrix: |
| 71 | + shell: [jsc, spidermonkey, v8] |
| 72 | + suite: [default, disabled, main] |
| 73 | + steps: |
| 74 | + - *checkout-branch |
| 75 | + - *setup-node |
| 76 | + - *install-node-packages |
| 77 | + |
| 78 | + - name: Extract Week Number |
| 79 | + run: echo "WEEK_NUMBER=$(date +%W)" >> $GITHUB_ENV |
44 | 80 |
|
45 | 81 | - name: Cache jsvu Binaries |
46 | 82 | uses: actions/cache@v4 |
47 | 83 | with: |
48 | 84 | path: ~/.jsvu |
49 | | - key: ${{ runner.os }}-jsvu-${{ matrix.browser }}-week-${{ env.WEEK_NUMBER }} |
| 85 | + key: ${{ runner.os }}-jsvu-${{ matrix.shell }}-week-${{ env.WEEK_NUMBER }} |
50 | 86 |
|
51 | 87 | - name: Run Tests |
52 | 88 | run: | |
53 | 89 | echo "Running in $BROWSER" |
54 | | - npm run test:${{ matrix.browser }} |
| 90 | + npm run test:${{ matrix.shell }} -- ${{ matrix.suite }} |
| 91 | + build: |
| 92 | + name: Test Build |
| 93 | + runs-on: ubuntu-latest |
| 94 | + steps: |
| 95 | + - name: Checkout Branch |
| 96 | + uses: actions/checkout@v4 |
| 97 | + with: |
| 98 | + fetch-depth: ${{ github.event_name == 'pull_request' && 2 || 0 }} |
| 99 | + |
| 100 | + - *setup-node |
| 101 | + - *install-node-packages |
| 102 | + |
| 103 | + - name: Run Build |
| 104 | + run: | |
| 105 | + if ${{ github.event_name == 'pull_request' }}; then |
| 106 | + npm run test:build -- --diff="HEAD^...HEAD" |
| 107 | + else |
| 108 | + npm run test:build -- --diff="${{ github.event.before }}...${{ github.event.after }}" |
| 109 | + fi |
| 110 | +
|
0 commit comments