From 6af7beb838e5a630f68c761f95712807d35a9c03 Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Tue, 27 Aug 2024 21:33:28 +0200 Subject: [PATCH 1/2] Copy dump-validators.yml to update-screenshots.yml --- .github/workflows/update-screenshots.yml | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update-screenshots.yml diff --git a/.github/workflows/update-screenshots.yml b/.github/workflows/update-screenshots.yml new file mode 100644 index 0000000000..ee8a46326c --- /dev/null +++ b/.github/workflows/update-screenshots.yml @@ -0,0 +1,36 @@ +name: dump-validators + +on: + # Triggered monthly or manually in https://github.com/oasisprotocol/wallet/actions/workflows/dump-validators.yml + workflow_dispatch: + schedule: + - cron: '0 0 1 * *' + +permissions: # Limit secrets.GITHUB_TOKEN permissions + contents: write + pull-requests: write + +jobs: + dump-validators: + if: github.repository == 'oasisprotocol/wallet' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: bash ./.github/dump_validators.sh + - name: Create Change Log fragment + env: + FILE_NAME: .changelog/${{ github.event.pull_request.number }}.internal.md + run: echo "Update dumped validators" > "$FILE_NAME" + - name: Create Pull Request with updated dumped validators + # https://github.com/peter-evans/create-pull-request + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + commit-message: 'Update dumped validators' + title: 'Update dumped validators' + body: | + Created by https://github.com/oasisprotocol/wallet/blob/master/.github/workflows/dump-validators.yml + + If CI actions and checks don't run in this PR: close it and reopen. + https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs + labels: bot From 2c2e1e979cfac18cc97b69a7f81922fa28deca4f Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Tue, 27 Aug 2024 21:33:40 +0200 Subject: [PATCH 2/2] Add monthly cron job to update screenshots --- .changelog/2049.process.md | 1 + .github/workflows/dump-validators.yml | 1 + .github/workflows/update-screenshots.yml | 38 ++++++++++++++++++------ 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 .changelog/2049.process.md diff --git a/.changelog/2049.process.md b/.changelog/2049.process.md new file mode 100644 index 0000000000..c514fe7d0a --- /dev/null +++ b/.changelog/2049.process.md @@ -0,0 +1 @@ +Add monthly cron job to update screenshots diff --git a/.github/workflows/dump-validators.yml b/.github/workflows/dump-validators.yml index ee8a46326c..c58032b657 100644 --- a/.github/workflows/dump-validators.yml +++ b/.github/workflows/dump-validators.yml @@ -26,6 +26,7 @@ jobs: uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} + branch: create-pull-request/dump-validators commit-message: 'Update dumped validators' title: 'Update dumped validators' body: | diff --git a/.github/workflows/update-screenshots.yml b/.github/workflows/update-screenshots.yml index ee8a46326c..60fdcd480f 100644 --- a/.github/workflows/update-screenshots.yml +++ b/.github/workflows/update-screenshots.yml @@ -1,7 +1,7 @@ -name: dump-validators +name: update-screenshots on: - # Triggered monthly or manually in https://github.com/oasisprotocol/wallet/actions/workflows/dump-validators.yml + # Triggered monthly or manually in https://github.com/oasisprotocol/wallet/actions/workflows/update-screenshots.yml workflow_dispatch: schedule: - cron: '0 0 1 * *' @@ -11,25 +11,45 @@ permissions: # Limit secrets.GITHUB_TOKEN permissions pull-requests: write jobs: - dump-validators: + update-screenshots: if: github.repository == 'oasisprotocol/wallet' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - run: bash ./.github/dump_validators.sh + - name: Set up Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: yarn + - name: Install dependencies + run: yarn install --frozen-lockfile + + - run: REACT_APP_E2E_TEST=1 yarn start & + - name: Install playwright's npm dependencies + working-directory: ./playwright/ + run: yarn install --frozen-lockfile + - name: Install playwright's system dependencies + working-directory: ./playwright/ + run: npx playwright install --with-deps + - run: npx wait-on http://localhost:3000/ --timeout 60000 + - name: Run playwright tests (with xvfb-run to support headed extension test) + working-directory: ./playwright/ + run: xvfb-run yarn test:screenshots + - name: Create Change Log fragment env: FILE_NAME: .changelog/${{ github.event.pull_request.number }}.internal.md - run: echo "Update dumped validators" > "$FILE_NAME" - - name: Create Pull Request with updated dumped validators + run: echo "Update screenshots" > "$FILE_NAME" + - name: Create Pull Request with updated screenshots # https://github.com/peter-evans/create-pull-request uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }} - commit-message: 'Update dumped validators' - title: 'Update dumped validators' + branch: create-pull-request/update-screenshots + commit-message: 'Update screenshots' + title: 'Update screenshots' body: | - Created by https://github.com/oasisprotocol/wallet/blob/master/.github/workflows/dump-validators.yml + Created by https://github.com/oasisprotocol/wallet/blob/master/.github/workflows/update-screenshots.yml If CI actions and checks don't run in this PR: close it and reopen. https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs