|
| 1 | +name: update-screenshots |
| 2 | + |
| 3 | +on: |
| 4 | + # Triggered monthly or manually in https://github.com/oasisprotocol/wallet/actions/workflows/update-screenshots.yml |
| 5 | + workflow_dispatch: |
| 6 | + schedule: |
| 7 | + - cron: '0 0 1 * *' |
| 8 | + |
| 9 | +permissions: # Limit secrets.GITHUB_TOKEN permissions |
| 10 | + contents: write |
| 11 | + pull-requests: write |
| 12 | + |
| 13 | +jobs: |
| 14 | + update-screenshots: |
| 15 | + if: github.repository == 'oasisprotocol/wallet' |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Set up Node.js 18 |
| 20 | + uses: actions/setup-node@v4 |
| 21 | + with: |
| 22 | + node-version: '18.x' |
| 23 | + cache: yarn |
| 24 | + - name: Install dependencies |
| 25 | + run: yarn install --frozen-lockfile |
| 26 | + |
| 27 | + - run: REACT_APP_E2E_TEST=1 yarn start & |
| 28 | + - name: Install playwright's npm dependencies |
| 29 | + working-directory: ./playwright/ |
| 30 | + run: yarn install --frozen-lockfile |
| 31 | + - name: Install playwright's system dependencies |
| 32 | + working-directory: ./playwright/ |
| 33 | + run: npx playwright install --with-deps |
| 34 | + - run: npx wait-on http://localhost:3000/ --timeout 60000 |
| 35 | + - name: Run playwright tests (with xvfb-run to support headed extension test) |
| 36 | + working-directory: ./playwright/ |
| 37 | + run: xvfb-run yarn test:screenshots |
| 38 | + |
| 39 | + - name: Create Change Log fragment |
| 40 | + env: |
| 41 | + FILE_NAME: .changelog/${{ github.event.pull_request.number }}.internal.md |
| 42 | + run: echo "Update screenshots" > "$FILE_NAME" |
| 43 | + - name: Create Pull Request with updated screenshots |
| 44 | + # https://github.com/peter-evans/create-pull-request |
| 45 | + uses: peter-evans/create-pull-request@v5 |
| 46 | + with: |
| 47 | + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} |
| 48 | + branch: create-pull-request/update-screenshots |
| 49 | + commit-message: 'Update screenshots' |
| 50 | + title: 'Update screenshots' |
| 51 | + body: | |
| 52 | + Created by https://github.com/oasisprotocol/wallet/blob/master/.github/workflows/update-screenshots.yml |
| 53 | +
|
| 54 | + If CI actions and checks don't run in this PR: close it and reopen. |
| 55 | + https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs |
| 56 | + labels: bot |
0 commit comments