| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 430c69d commit a932fbd
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,56 @@ | |||
| 1 | + name: Run undici WPT (current) | ||
| 2 | + description: Runs undici WPT tests for undici >= 7 and merges results into the Node.js WPT report | ||
| 3 | + | ||
| 4 | + inputs: | ||
| 5 | + undici-version: | ||
| 6 | + required: true | ||
| 7 | + description: undici version tag to checkout | ||
| 8 | + wpt-report: | ||
| 9 | + required: true | ||
| 10 | + description: Path to the Node.js WPT report to merge into | ||
| 11 | + | ||
| 12 | + runs: | ||
| 13 | + using: composite | ||
| 14 | + steps: | ||
| 15 | + - name: Checkout undici | ||
| 16 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| 17 | + with: | ||
| 18 | + repository: nodejs/undici | ||
| 19 | + persist-credentials: false | ||
| 20 | + path: undici | ||
| 21 | + clean: false | ||
| 22 | + ref: ${{ inputs.undici-version }} | ||
| 23 | + - name: Prepare WPT checkout | ||
| 24 | + shell: bash | ||
| 25 | + run: | | ||
| 26 | + rm -rf undici/test/web-platform-tests/wpt | ||
| 27 | + mv test/fixtures/wpt undici/test/web-platform-tests/wpt | ||
| 28 | + - name: Configure hosts | ||
| 29 | + shell: bash | ||
| 30 | + working-directory: undici/test/web-platform-tests/wpt | ||
| 31 | + run: python3 wpt make-hosts-file | sudo tee -a /etc/hosts | ||
| 32 | + - name: Install dependencies | ||
| 33 | + shell: bash | ||
| 34 | + working-directory: undici | ||
| 35 | + run: npm install | ||
| 36 | + - name: Run WPT | ||
| 37 | + shell: bash | ||
| 38 | + working-directory: undici | ||
| 39 | + env: | ||
| 40 | + CI: 'true' | ||
| 41 | + WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json | ||
| 42 | + run: npm run test:wpt || true | ||
| 43 | + - name: Merge report | ||
| 44 | + shell: bash | ||
| 45 | + env: | ||
| 46 | + NODE_WPT_REPORT: ${{ inputs.wpt-report }} | ||
| 47 | + UNDICI_WPT_REPORT: ${{ github.workspace }}/undici/wptreport.json | ||
| 48 | + run: | | ||
| 49 | + if [ -f "$UNDICI_WPT_REPORT" ]; then | ||
| 50 | + jq -sc ' | ||
| 51 | + .[0].results += .[1].results | | ||
| 52 | + .[0].time_end = .[1].time_end | | ||
| 53 | + .[0] | ||
| 54 | + ' "$NODE_WPT_REPORT" "$UNDICI_WPT_REPORT" > "${NODE_WPT_REPORT}.tmp" | ||
| 55 | + mv "${NODE_WPT_REPORT}.tmp" "$NODE_WPT_REPORT" | ||
| 56 | + fi | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,37 @@ | |||
| 1 | + name: Run undici WPT (legacy) | ||
| 2 | + description: Runs undici WPT tests for undici < 7 and appends results to the Node.js WPT report | ||
| 3 | + | ||
| 4 | + inputs: | ||
| 5 | + undici-version: | ||
| 6 | + required: true | ||
| 7 | + description: undici version tag to checkout | ||
| 8 | + wpt-report: | ||
| 9 | + required: true | ||
| 10 | + description: Path to the Node.js WPT report | ||
| 11 | + | ||
| 12 | + runs: | ||
| 13 | + using: composite | ||
| 14 | + steps: | ||
| 15 | + - name: Checkout undici | ||
| 16 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| 17 | + with: | ||
| 18 | + repository: nodejs/undici | ||
| 19 | + persist-credentials: false | ||
| 20 | + path: undici | ||
| 21 | + clean: false | ||
| 22 | + ref: ${{ inputs.undici-version }} | ||
| 23 | + - name: Prepare WPT checkout | ||
| 24 | + shell: bash | ||
| 25 | + run: | | ||
| 26 | + rm -rf undici/test/wpt/tests | ||
| 27 | + mv test/fixtures/wpt undici/test/wpt/tests | ||
| 28 | + - name: Install dependencies | ||
| 29 | + shell: bash | ||
| 30 | + working-directory: undici | ||
| 31 | + run: npm install | ||
| 32 | + - name: Run WPT | ||
| 33 | + shell: bash | ||
| 34 | + working-directory: undici | ||
| 35 | + env: | ||
| 36 | + WPT_REPORT: ${{ inputs.wpt-report }} | ||
| 37 | + run: npm run test:wpt || true | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,6 +95,48 @@ jobs: | |||
| 95 | 95 | echo "WPT_REPORT=$(pwd)/out/wpt/wptreport.json" >> $GITHUB_ENV | |
| 96 | 96 | fi | |
| 97 | 97 | ||
| 98 | + # undici WPT Runner | ||
| 99 | + - name: Set env.UNDICI_VERSION | ||
| 100 | + if: ${{ env.WPT_REPORT != '' }} | ||
| 101 | + run: | | ||
| 102 | + UNDICI_VERSION=$(jq -r '.version' < deps/undici/src/package.json) | ||
| 103 | + echo "UNDICI_VERSION=v$UNDICI_VERSION" >> $GITHUB_ENV | ||
| 104 | + if [ "${UNDICI_VERSION%%.*}" -ge 7 ]; then | ||
| 105 | + echo "UNDICI_WPT=current" >> $GITHUB_ENV | ||
| 106 | + else | ||
| 107 | + echo "UNDICI_WPT=legacy" >> $GITHUB_ENV | ||
| 108 | + fi | ||
| 109 | + # Checkout composite actions from the default branch since the | ||
| 110 | + # version-specific checkout above overwrites .github/actions/ | ||
| 111 | + - name: Checkout undici WPT actions | ||
| 112 | + if: ${{ env.WPT_REPORT != '' }} | ||
| 113 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| 114 | + with: | ||
| 115 | + sparse-checkout: | | ||
| 116 | + .github/actions/undici-wpt-current | ||
| 117 | + .github/actions/undici-wpt-legacy | ||
| 118 | + sparse-checkout-cone-mode: false | ||
| 119 | + persist-credentials: false | ||
| 120 | + path: _wpt_actions | ||
| 121 | + clean: false | ||
| 122 | + - name: Place undici WPT actions | ||
| 123 | + if: ${{ env.WPT_REPORT != '' }} | ||
| 124 | + run: | | ||
| 125 | + mkdir -p .github/actions | ||
| 126 | + cp -r _wpt_actions/.github/actions/undici-wpt-* .github/actions/ | ||
| 127 | + - name: Run undici WPT (current) | ||
| 128 | + if: ${{ env.UNDICI_WPT == 'current' }} | ||
| 129 | + uses: ./.github/actions/undici-wpt-current | ||
| 130 | + with: | ||
| 131 | + undici-version: ${{ env.UNDICI_VERSION }} | ||
| 132 | + wpt-report: ${{ env.WPT_REPORT }} | ||
| 133 | + - name: Run undici WPT (legacy) | ||
| 134 | + if: ${{ env.UNDICI_WPT == 'legacy' }} | ||
| 135 | + uses: ./.github/actions/undici-wpt-legacy | ||
| 136 | + with: | ||
| 137 | + undici-version: ${{ env.UNDICI_VERSION }} | ||
| 138 | + wpt-report: ${{ env.WPT_REPORT }} | ||
| 139 | + | ||
| 98 | 140 | # Upload artifacts | |
| 99 | 141 | - name: Clone report for upload | |
| 100 | 142 | if: ${{ env.WPT_REPORT != '' }} | |
| Back | FazBrowse Home | New Git URL |
0 commit comments