-
Notifications
You must be signed in to change notification settings - Fork 29.6k
70 lines (60 loc) · 2.38 KB
/
update-wpt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: WPT update
on:
schedule:
# Run once a week at 12:00 AM UTC on Sunday.
- cron: 0 0 * * *
workflow_dispatch:
permissions:
contents: read
jobs:
wpt-subsystem-update:
runs-on: ubuntu-latest
strategy:
matrix:
subsystem:
- url
steps:
- uses: actions/checkout@v4@6d193bf28034eafb982f37bd894289fe649468fc
with:
persist-credentials: false
- name: Update WPT for subsystem ${{ matrix.subsystem }}
run: |
git node wpt update --subsystem=${{ matrix.subsystem }}
env:
GH_TOKEN: ${{ secrets.GH_USER_TOKEN }}
- name: Run WPT tests
id: run-wpt-tests
run: |
git node wpt run --subsystem=${{ matrix.subsystem }} || echo "WPT tests failed" > wpt-failure.txt
continue-on-error: true
env:
GH_USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Handle test failures and success
run: |
if [[ "$(git status --porcelain)" != "" ]]; then
git config --global user.name "${{ github.actor }}[bot]"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git checkout -b actions/update-wpt-${{ matrix.subsystem }}
git add .
git commit -m "test: update WPT for ${{ matrix.subsystem }} to ${{ env.NEW_VERSION }}"
gh auth setup-git
git push origin actions/update-wpt-${{ matrix.subsystem }} -fu --no-verify
echo "createPR=true" >> "$GITHUB_OUTPUT"
else
echo "No changes to commit."
fi
env:
GH_USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Open or update PR for the subsystem update
if: steps.push-changes.outputs.createPR
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: actions/update-wpt-${{ matrix.subsystem }}
title: 'test: update WPT for ${{ matrix.subsystem }} to ${{ env.NEW_VERSION }}'
body: |
This is an automated update of the WPT for ${{ matrix.subsystem }} to ${{ env.NEW_VERSION }}.
${{ steps.run-wpt-tests.outcome == 'failure' && 'Note: The WPT tests failed during the update. Please review the failure details below:' }}
${{ steps.run-wpt-tests.outputs.result }}
env:
GH_USER_TOKEN: ${{ secrets.GITHUB_TOKEN }}