-
Notifications
You must be signed in to change notification settings - Fork 5
137 lines (115 loc) · 3.29 KB
/
test.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
name: Tests and Checks
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- develop
env:
FOUNDRY_PROFILE: ci
TERM: ansi
permissions:
security-events: write
jobs:
security:
uses: lidofinance/linters/.github/workflows/security.yml@master
actions:
uses: lidofinance/linters/.github/workflows/actions.yml@master
# Maybe to make it reusable workflow instead?
bootstrap:
name: Bootstrap environment
runs-on: ubuntu-latest
outputs:
cache-path: ${{ steps.cache.outputs.path }}
cache-key: ${{ steps.cache.outputs.key }}
env:
JUST_TAG: 1.24.0
steps:
- name: Build cache params
id: cache
run: |
echo "path=$CACHE_PATH" >> "$GITHUB_OUTPUT"
echo "$KEY_INPUT" | md5sum | awk '{print $1}' | xargs -I% echo "key=cargobin-%-${RUNNER_OS}" >> "$GITHUB_OUTPUT"
env:
CACHE_PATH: |
~/.cargo/bin/
KEY_INPUT: |
just:${{env.JUST_TAG}}
- uses: actions/cache@v4
id: get-cache
with:
path: ${{ steps.cache.outputs.path }}
key: ${{ steps.cache.outputs.key }}
- name: Install just
run: cargo install "just@$JUST_TAG"
if: steps.get-cache.outputs.cache-hit != 'true'
linters:
name: Linters
runs-on: ubuntu-latest
needs: bootstrap
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache@v4
with:
path: ${{ needs.bootstrap.outputs.cache-path }}
key: ${{ needs.bootstrap.outputs.cache-key }}
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: just deps-dev
- name: Linters check
run: just lint
foundry:
name: Foundry project
runs-on: ubuntu-latest
needs: bootstrap
env:
FORGE_REV: v0.3.0
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/cache@v4
with:
path: ${{ needs.bootstrap.outputs.cache-path }}
key: ${{ needs.bootstrap.outputs.cache-key }}
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: ${{ env.FORGE_REV }}
- name: Install node
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: just deps
- name: Build
run: just build --sizes
- name: Run unit-tests
run: just test-unit
- name: Run local integration tests
run: just test-local
env:
CHAIN: holesky
RPC_URL: ${{ secrets.RPC_URL_HOLESKY }}
- name: Run post-vote tests after upgrade
run: just test-upgrade
env:
CHAIN: mainnet
DEPLOY_CONFIG: ./artifacts/mainnet/deploy-mainnet.json
RPC_URL: ${{ secrets.RPC_URL_MAINNET }}
# TODO: Enable later
# - name: Check gas report
# run: just gas-report && git diff --exit-code GAS.md
# env:
# RPC_URL: ${{ secrets.RPC_URL }}