-
Notifications
You must be signed in to change notification settings - Fork 45
121 lines (107 loc) · 4.3 KB
/
checks.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Checks if all addresses are verified and generates a diff if not
# Also checks for sanity of values (by performing various checks to ensure correctness)
name: Checks
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
on:
pull_request:
push:
branches:
- main
jobs:
sanity:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
cache: "yarn"
- name: install
run: yarn install --frozen-lockfile
- name: verify
run: yarn check:sanity
env:
RPC_MAINNET: ${{ secrets.RPC_MAINNET }}
RPC_POLYGON: ${{ secrets.RPC_POLYGON }}
RPC_AVALANCHE: ${{ secrets.RPC_AVALANCHE }}
RPC_OPTIMISM: ${{ secrets.RPC_OPTIMISM }}
RPC_ARBITRUM: ${{ secrets.RPC_ARBITRUM }}
RPC_BASE: ${{ secrets.RPC_BASE }}
RPC_GNOSIS: ${{ secrets.RPC_GNOSIS }}
RPC_BNB: ${{ secrets.RPC_BNB }}
RPC_METIS: ${{ secrets.RPC_METIS }}
RPC_SCROLL: ${{ secrets.RPC_SCROLL }}
verification:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
registry-url: "https://registry.npmjs.org"
cache: "yarn"
- name: install
run: yarn install --frozen-lockfile
- name: Cache Restore
id: cache
uses: actions/cache/restore@v4
with:
path: cache
key: ${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}-
${{ runner.os }}-verification-
${{ runner.os }}-
- name: Create backup
if: steps.cache.outputs.cache-matched-key != ''
run: |
cd cache
ls -l
cd ..
cp cache/errors.json cache/errors.backup.json || :
cp cache/verification.json cache/verification.backup.json || :
- name: verify
run: yarn check:verification
# the verification step will exit with error code whenever there is a non verified contract
# we don't want the ci to fail yet though as there are already unverified contracts
# we might consider removing this in the future
continue-on-error: true
env:
ETHERSCAN_API_KEY_MAINNET: ${{ secrets.ETHERSCAN_API_KEY_MAINNET }}
ETHERSCAN_API_KEY_POLYGON: ${{ secrets.ETHERSCAN_API_KEY_POLYGON }}
ETHERSCAN_API_KEY_ARBITRUM: ${{ secrets.ETHERSCAN_API_KEY_ARBITRUM }}
ETHERSCAN_API_KEY_OPTIMISM: ${{ secrets.ETHERSCAN_API_KEY_OPTIMISM }}
ETHERSCAN_API_KEY_SCROLL: ${{ secrets.ETHERSCAN_API_KEY_SCROLL }}
ETHERSCAN_API_KEY_BNB: ${{ secrets.ETHERSCAN_API_KEY_BNB }}
ETHERSCAN_API_KEY_BASE: ${{ secrets.ETHERSCAN_API_KEY_BASE }}
ETHERSCAN_API_KEY_ZKSYNC: ${{ secrets.ETHERSCAN_API_KEY_ZKSYNC }}
ETHERSCAN_API_KEY_GNOSIS: ${{ secrets.ETHERSCAN_API_KEY_GNOSIS }}
ETHERSCAN_API_KEY_ZKEVM: ${{ secrets.ETHERSCAN_API_KEY_ZKEVM }}
ETHERSCAN_API_KEY_AVALANCHE: ${{ secrets.ETHERSCAN_API_KEY_AVALANCHE }}
- name: diff
if: steps.cache.outputs.cache-matched-key != ''
run: |
git diff --no-index --diff-algorithm=patience --ignore-space-at-eol cache/errors.backup.json cache/errors.json || :
git diff --no-index --diff-algorithm=patience --ignore-space-at-eol cache/verification.backup.json cache/verification.json || :
- name: Remove backup
if: steps.cache.outputs.cache-matched-key != ''
run: |
rm cache/errors.backup.json || :
rm cache/verification.backup.json || :
- name: Cache Save
# if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
uses: actions/cache/save@v4
with:
path: cache
key: ${{ runner.os }}-verification-${{ hashFiles('safe.csv') }}-${{ github.sha }}