|
| 1 | +name: Update WPT |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + # Run once a week at 12:00 AM UTC on Sunday. |
| 7 | + - cron: 0 0 * * * |
| 8 | + |
| 9 | +jobs: |
| 10 | + update-wpt: |
| 11 | + name: Update WPT |
| 12 | + permissions: |
| 13 | + contents: write |
| 14 | + pull-requests: write |
| 15 | + runs-on: ubuntu-latest |
| 16 | + steps: |
| 17 | + - name: Checkout Repository |
| 18 | + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
| 19 | + with: |
| 20 | + persist-credentials: false |
| 21 | + - name: Update WPT |
| 22 | + run: | |
| 23 | + rm -rf test/fixtures/wpt && mkdir test/fixtures/wpt && |
| 24 | + - name: Clone WPT Repository |
| 25 | + uses: actions/checkout@v2 |
| 26 | + with: |
| 27 | + repository: web-platform-tests/wpt |
| 28 | + ref: ${{ github.sha }} |
| 29 | + path: test/fixtures/tmp-wpt |
| 30 | + sparse_checkout: common/ eventsource/ fetch/ interfaces/ mimesniff/ resources/ service-workers/ storage/ websockets/ xhr/ |
| 31 | + - name: Move WPT Files |
| 32 | + run: | |
| 33 | + mv test/fixtures/tmp-wpt/LICENSE.md test/fixtures/wpt/LICENSE.md && |
| 34 | + mv test/fixtures/tmp-wpt/common test/fixtures/wpt/common && |
| 35 | + mv test/fixtures/tmp-wpt/eventsource test/fixtures/wpt/eventsource && |
| 36 | + mv test/fixtures/tmp-wpt/fetch test/fixtures/wpt/fetch && |
| 37 | + mv test/fixtures/tmp-wpt/interfaces test/fixtures/wpt/interfaces && |
| 38 | + mv test/fixtures/tmp-wpt/mimesniff test/fixtures/wpt/mimesniff && |
| 39 | + mv test/fixtures/tmp-wpt/resources test/fixtures/wpt/resources && |
| 40 | + mv test/fixtures/tmp-wpt/service-workers test/fixtures/wpt/service-workers && |
| 41 | + mv test/fixtures/tmp-wpt/storage test/fixtures/wpt/storage && |
| 42 | + mv test/fixtures/tmp-wpt/websockets test/fixtures/wpt/websockets && |
| 43 | + mv test/fixtures/tmp-wpt/xhr test/fixtures/wpt/xhr && |
| 44 | + rm -rf test/fixtures/tmp-wpt/.git |
| 45 | + - name: Create Pull Request |
| 46 | + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 |
| 47 | + with: |
| 48 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 49 | + branch: actions/wpt-update |
| 50 | + title: Update WPT |
| 51 | + body: Automated update of the WPT |
| 52 | + commit-message: 'test: update wpt test' |
0 commit comments