forked from GoogleChromeLabs/container-query-polyfill
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (57 loc) · 1.89 KB
/
update_baseline.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
name: Update WPT Baseline
on:
workflow_dispatch:
branches: [main]
schedule:
- cron: '0 0 * * 1'
jobs:
build:
runs-on: ubuntu-latest
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
WPT_MANIFEST: ${{ github.workspace }}/wpt/MANIFEST.json
SCHEDULED_BASELINE_DIFF: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
- uses: actions/setup-python@v3
with:
python-version: '3.x'
- uses: actions/checkout@v3
with:
repository: Marshal27/wpt
path: wpt
ref: x-polyfill-all-tests
- name: Build
run: |
npm install
npm run build:wpt
- name: Setup WPT
run: |
cd wpt
pip install virtualenv
./wpt make-hosts-file | sudo tee -a /etc/hosts
- name: Run Tests
run: |
npm run serve &
./wpt/wpt manifest
./wpt/wpt serve --inject-script=${{ github.workspace }}/dist/shadow-container-query-polyfill.modern.mjs &
npm test
- name: Open Pull Request
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ret=(node --loader ts-node/esm ./tests/diff.ts)
if [ $ret == "changed" ]; then
npm run prettier:fix
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git checkout -b update-wpt-baseline-$(date +"%Y-%m-%d")
git add ./tests/baseline.json
git commit -m "Update Web Platform Test baseline"
git push -u origin HEAD
gh pr create --title "[Automated] Update Web Platform Tests" --body-file ./tests/pr.txt --label "update-baseline"
fi