Skip to content

Commit

Permalink
ci to update known good
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Jul 9, 2024
1 parent 6f241d4 commit 10ad2a9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,4 @@ jobs:
node-version: 18.x
cache: 'yarn'
- run: yarn --immutable
- run: yarn update-env
- run: yarn test packages/${{ matrix.tests }}
33 changes: 29 additions & 4 deletions .github/workflows/update-known-good.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Update KNOWN_GOOD_BLOCK_NUMBERS
name: Update Known Good Block Numbers

on:
workflow_dispatch:
Expand All @@ -14,7 +14,27 @@ permissions:
pull-requests: write # required for create pr

jobs:
update:
define-matrix:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.tests.outputs.tests }}
steps:
- uses: actions/checkout@v4
- name: Define Tests
id: tests
run: |
echo tests=$(cd packages && ls */src/*.test.ts | jq -R -s -c 'split("\n")[:-1]') >> "$GITHUB_OUTPUT"
- name: Update Known Good Block Numbers
run: |
yarn update-known-good
cat KNOWN_GOOD_BLOCK_NUMBERS.env >> $GITHUB_ENV
tests:
needs: define-matrix
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
tests: ${{ fromJSON(needs.define-matrix.outputs.tests) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -24,10 +44,15 @@ jobs:
node-version: 18.x
cache: 'yarn'
- run: yarn --immutable
- run: yarn update-known-good
- run: yarn test
- run: echo $ACALA_BLOCK_NUMBER
- run: yarn test packages/${{ matrix.tests }}
save:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Commit and push changes
run: |
export | grep BLOCK_NUMBER > KNOWN_GOOD_BLOCK_NUMBERS.env
git config --global user.name 'github-actions[bot]'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add KNOWN_GOOD_BLOCK_NUMBERS.env
Expand Down
2 changes: 0 additions & 2 deletions KNOWN_GOOD_BLOCK_NUMBERS.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
ACALA_BLOCK_NUMBER=6515606
ACALANEXT_BLOCK_NUMBER=6515606
ASSETHUBKUSAMA_BLOCK_NUMBER=7304610
ASSETHUBPOLKADOT_BLOCK_NUMBER=6618583
ASTAR_BLOCK_NUMBER=6535047
BASILISK_BLOCK_NUMBER=6126134
HYDRADX_BLOCK_NUMBER=5480358
KARURA_BLOCK_NUMBER=7210523
KARURANEXT_BLOCK_NUMBER=7210523
KUSAMA_BLOCK_NUMBER=23904796
MOONBEAM_BLOCK_NUMBER=6519376
MOONRIVER_BLOCK_NUMBER=7191837
Expand Down

0 comments on commit 10ad2a9

Please sign in to comment.