|
| 1 | +# This workflow runs every night and tests various versions of Node.js |
| 2 | +# (main branch build, current, and two latest LTS release lines) against the |
| 3 | +# `epochs/daily` branch of WPT. |
| 4 | + |
| 5 | +name: Daily WPT report |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_dispatch: |
| 9 | + schedule: |
| 10 | + # This is 20 minutes after `epochs/daily` branch is triggered to be created |
| 11 | + # in WPT repo. |
| 12 | + # https://github.com/web-platform-tests/wpt/blob/master/.github/workflows/epochs.yml |
| 13 | + - cron: 30 0 * * * |
| 14 | + |
| 15 | +env: |
| 16 | + PYTHON_VERSION: '3.11' |
| 17 | + |
| 18 | +permissions: |
| 19 | + contents: read |
| 20 | + |
| 21 | +jobs: |
| 22 | + generate: |
| 23 | + strategy: |
| 24 | + matrix: |
| 25 | + ref: |
| 26 | + - main |
| 27 | + - current |
| 28 | + - lts/* |
| 29 | + - lts/-1 |
| 30 | + fail-fast: false |
| 31 | + runs-on: ubuntu-latest |
| 32 | + continue-on-error: true |
| 33 | + steps: |
| 34 | + - name: Set up Python ${{ env.PYTHON_VERSION }} |
| 35 | + uses: actions/setup-python@v4 |
| 36 | + with: |
| 37 | + python-version: ${{ env.PYTHON_VERSION }} |
| 38 | + - name: Environment Information |
| 39 | + run: npx envinfo |
| 40 | + |
| 41 | + # checkout main & build |
| 42 | + - name: Checkout ${{ matrix.ref }} branch |
| 43 | + if: matrix.ref == 'main' |
| 44 | + uses: actions/checkout@v3 |
| 45 | + with: |
| 46 | + ref: ${{ matrix.ref }} |
| 47 | + persist-credentials: false |
| 48 | + - name: Build Node.js |
| 49 | + if: matrix.ref == 'main' |
| 50 | + run: make build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" |
| 51 | + |
| 52 | + # or install a version and checkout |
| 53 | + - name: Install Node.js |
| 54 | + if: matrix.ref != 'main' |
| 55 | + id: setup-node |
| 56 | + uses: actions/setup-node@v3 |
| 57 | + with: |
| 58 | + node-version: ${{ matrix.ref }} |
| 59 | + - name: Checkout ${{ steps.setup-node.outputs.node-version }} |
| 60 | + uses: actions/checkout@v3 |
| 61 | + if: matrix.ref != 'main' |
| 62 | + with: |
| 63 | + persist-credentials: false |
| 64 | + ref: ${{ steps.setup-node.outputs.node-version }} |
| 65 | + - name: Set env.NODE |
| 66 | + if: matrix.ref != 'main' |
| 67 | + run: echo "NODE=$(which node)" >> $GITHUB_ENV |
| 68 | + |
| 69 | + # replace checked out WPT with the synchronized branch |
| 70 | + - name: Remove stale WPT |
| 71 | + run: rm -rf wpt |
| 72 | + working-directory: test/fixtures |
| 73 | + - name: Checkout epochs/daily WPT |
| 74 | + uses: actions/checkout@v3 |
| 75 | + with: |
| 76 | + repository: web-platform-tests/wpt |
| 77 | + persist-credentials: false |
| 78 | + path: test/fixtures/wpt |
| 79 | + clean: false |
| 80 | + ref: epochs/daily |
| 81 | + - name: Set env.WPT_REVISION |
| 82 | + run: echo "WPT_REVISION=$(git rev-parse HEAD)" >> $GITHUB_ENV |
| 83 | + working-directory: test/fixtures/wpt |
| 84 | + |
| 85 | + - name: Run WPT and generate report |
| 86 | + run: make test-wpt-report || true |
| 87 | + env: |
| 88 | + NODE_REVISION: ${{ github.sha }} |
| 89 | + - name: Upload WPT Report to wpt.fyi API |
| 90 | + env: |
| 91 | + WPT_FYI_USERNAME: Node.js |
| 92 | + WPT_FYI_PASSWORD: ${{ secrets.WPT_FYI_PASSWORD }} |
| 93 | + working-directory: out/wpt |
| 94 | + run: | |
| 95 | + gzip wptreport.json |
| 96 | + curl \ |
| 97 | + -u "$WPT_FYI_USERNAME:$WPT_FYI_PASSWORD" \ |
| 98 | + |
| 99 | + https://wpt.fyi/api/results/upload |
| 100 | +
|
| 101 | + - name: Rename report |
| 102 | + run: mv wptreport.json wptreport-${{ steps.setup-node.outputs.node-version || github.sha }}.json |
| 103 | + working-directory: out/wpt |
| 104 | + - name: Upload GitHub Actions artifact |
| 105 | + uses: actions/upload-artifact@v3 |
| 106 | + with: |
| 107 | + path: out/wpt/wptreport-*.json |
| 108 | + name: WPT Reports |
| 109 | + if-no-files-found: ignore |
0 commit comments