forked from zksync-association/zk-governance
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (101 loc) · 3.14 KB
/
ci.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
name: L2 contracts ci
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
env:
FOUNDRY_PROFILE: ci
jobs:
build:
defaults:
run:
working-directory: ./l2-contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Install Foundry
uses: dutterbutter/foundry-zksync-toolchain@v1
- name: Cache build
uses: actions/cache@v3
with:
path: |
l2-contracts/out
l2-contracts/cache
l2-contracts/zkout
l2-contracts/lib
key: ${{ runner.os }}-build-${{ hashFiles('l2-contracts/foundry.toml') }}-${{ hashFiles('l2-contracts/src/**/*.sol') }}
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('l2-contracts/foundry.toml') }}-
${{ runner.os }}-build-
- name: Install dependencies
run: |
forge install --no-commit
npm install
- name: Build contracts
run: forge build --zksync
test:
needs: build
defaults:
run:
working-directory: ./l2-contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Install Foundry
uses: dutterbutter/foundry-zksync-toolchain@v1
- name: Cache build
uses: actions/cache@v3
with:
path: |
l2-contracts/out
l2-contracts/cache
l2-contracts/zkout
l2-contracts/lib
key: ${{ runner.os }}-build-${{ hashFiles('l2-contracts/foundry.toml') }}-${{ hashFiles('l2-contracts/src/**/*.sol') }}
restore-keys: |
${{ runner.os }}-build-${{ hashFiles('l2-contracts/foundry.toml') }}-
${{ runner.os }}-build-
- name: Run forge tests
run: |
# Run forge tests with lower fuzz runs for speed, only in our test directory
FOUNDRY_FUZZ_RUNS=10 forge test --match-path "test/*.t.sol" --no-match-path "test/*.integration.t.sol" --zksync
lint:
defaults:
run:
shell: bash
working-directory: ./l2-contracts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Install Foundry
uses: dutterbutter/foundry-zksync-toolchain@v1
- name: Install dependencies
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
forge install --no-commit --shallow
npm install
- name: Install scopelint
uses: engineerd/[email protected]
with:
name: scopelint
repo: ScopeLift/scopelint
fromGitHubReleases: true
version: latest
pathInArchive: scopelint-x86_64-linux/scopelint
urlTemplate: https://github.com/ScopeLift/scopelint/releases/download/{{version}}/scopelint-x86_64-linux.tar.xz
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check formatting
run: |
scopelint --version
scopelint check