-
Notifications
You must be signed in to change notification settings - Fork 7
81 lines (77 loc) · 2.23 KB
/
update-known-good.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Update Known Good Block Numbers
on:
workflow_dispatch:
schedule:
- cron: '0 */6 * * *'
env:
GH_TOKEN: ${{ github.token }}
permissions:
contents: write # required for push commit
pull-requests: write # required for create pr
jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
tests: ${{ steps.tests.outputs.tests }}
steps:
- uses: actions/checkout@v4
- name: setup node env
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'
- run: yarn --immutable
- 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
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: KNOWN_GOOD_BLOCK_NUMBERS.env
path: KNOWN_GOOD_BLOCK_NUMBERS.env
retention-days: 1
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
- name: setup node env
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'yarn'
- run: yarn --immutable
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: KNOWN_GOOD_BLOCK_NUMBERS.env
- run: yarn test packages/${{ matrix.tests }}
save:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: KNOWN_GOOD_BLOCK_NUMBERS.env
- name: Commit and push changes
run: |
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
if ! git diff --cached --quiet; then
git commit -m "[CI Skip] Update KNOWN_GOOD_BLOCK_NUMBERS"
git push
else
echo "No changes to commit"
fi