Update WPT Baseline #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: devknoll/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/container-query-polyfill.modern.js & | |
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 |