forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (132 loc) · 4.52 KB
/
wpt-nightly.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: WPT import
on:
schedule:
# Run this job at 00:00 everyday
- cron: "0 0 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-linux:
name: Build on Linux
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Bootstrap
run: |
python3 -m pip install --upgrade pip virtualenv
sudo apt update
python3 ./mach bootstrap
- name: Release build
run: python3 ./mach build --release
- name: Lockfile check
run: ./etc/ci/lockfile_changed.sh
- name: Forbidden panic check
run: ./etc/ci/check_no_panic.sh
- name: Package binary
run: tar -czf target.tar.gz target/release/servo resources
- name: Archive binary
uses: actions/upload-artifact@v3
with:
name: release-binary
path: target.tar.gz
linux-wpt:
name: Linux WPT Tests
runs-on: ubuntu-20.04
needs: ["build-linux"]
env:
max_chunk_id: 20
strategy:
matrix:
chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/download-artifact@v3
with:
name: release-binary
path: release-binary
- name: unPackage binary
run: tar -xzf release-binary/target.tar.gz
- name: Prep test environment
run: |
python3 -m pip install --upgrade pip virtualenv
sudo apt update
sudo apt install -qy --no-install-recommends libgl1 libssl1.1 libdbus-1-3 libxcb-xfixes0-dev libxcb-shape0-dev libunwind8 libegl1-mesa
wget http://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb
sudo apt install ./libffi6_3.2.1-8_amd64.deb
python3 ./mach bootstrap-gstreamer
- name: Fetch upstream changes before testing
run: |
./etc/ci/update-wpt-checkout fetch-upstream-changes
- name: Run tests
run: |
python3 ./mach test-wpt \
--release --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw test-wpt.${{ matrix.chunk_id }}.log \
--log-servojson wpt-jsonsummary.${{ matrix.chunk_id }}.log \
--always-succeed
- name: Archive logs
uses: actions/upload-artifact@v3
with:
name: wpt-logs-linux
path: |
test-wpt.${{ matrix.chunk_id }}.log
wpt-jsonsummary.${{ matrix.chunk_id }}.log
sync:
name: Synchronize WPT Nightly
runs-on: ubuntu-latest
needs:
- "build-linux"
- "linux-wpt"
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2
# Download all artifacts
- uses: actions/download-artifact@v3
- name: Prep environment
run: |
python3 -m pip install --upgrade pip virtualenv
sudo apt update
python3 ./mach bootstrap
- name: Add upstream remote
run: |
git config --local user.email "[email protected]"
git config --local user.name "WPT Sync Bot"
git remote add upstream https://github.com/servo/servo.git
git fetch --unshallow upstream
- name: Fetch upstream changes before syncing
run: |
./etc/ci/update-wpt-checkout fetch-upstream-changes
- name: Run WPT Update
env:
MAX_CHUNK_ID: 20
WPT_SYNC_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }}
run: |
export CURRENT_DATE=$(date +"%d-%m-%Y")
echo $CURRENT_DATE
echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV
./etc/ci/wpt-nightly-update.sh
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: wpt_update_${{ env.CURRENT_DATE }}
- name: Open PR
env:
GH_TOKEN: ${{ secrets.WPT_SYNC_TOKEN }}
UPDATE_BRANCH: wpt_update_${{ env.CURRENT_DATE }}
run: |
BODY=$(cat <<EOF
Automated downstream sync of changes from upstream as of ${{ env.CURRENT_DATE }}
[no-wpt-sync]
r? @servo-wpt-sync
EOF
)
gh pr create \
--title "Sync WPT with upstream (${{ env.CURRENT_DATE }})" \
--body "$BODY" --head ${{ env.UPDATE_BRANCH }} | xargs gh pr comment $1 --body "@bors-servo r+"