File tree Expand file tree Collapse file tree 4 files changed +79
-7
lines changed Expand file tree Collapse file tree 4 files changed +79
-7
lines changed Original file line number Diff line number Diff line change 1
- name : test
1
+ name : EVM CI
2
2
3
- on : workflow_dispatch
3
+ on :
4
+ workflow_dispatch :
5
+ pull_request :
6
+ push :
7
+ branches :
8
+ - main
4
9
5
10
env :
6
11
FOUNDRY_PROFILE : ci
10
15
strategy :
11
16
fail-fast : true
12
17
13
- name : Foundry project
18
+ name : forge test
14
19
runs-on : ubuntu-latest
15
20
steps :
16
21
- uses : actions/checkout@v4
@@ -24,11 +29,15 @@ jobs:
24
29
25
30
- name : Run Forge build
26
31
run : |
27
- forge --version
28
- forge build --sizes
32
+ make test-push0
29
33
id : build
30
34
31
35
- name : Run Forge tests
32
36
run : |
33
- forge test -vvv
37
+ make test-evm
34
38
id : test
39
+
40
+ - name : Run Forge fmt
41
+ run : |
42
+ make check-format
43
+ id : check
Original file line number Diff line number Diff line change
1
+ FROM ghcr.io/foundry-rs/foundry@sha256:8b843eb65cc7b155303b316f65d27173c862b37719dc095ef3a2ef27ce8d3c00 as builder
2
+
3
+ WORKDIR /app
4
+ COPY foundry.toml foundry.toml
5
+ COPY lib lib
6
+ COPY src src
7
+
8
+ RUN FOUNDRY_PROFILE=prod forge build
9
+
10
+ FROM scratch AS foundry-export
11
+
12
+ COPY --from=builder /app/out .
Original file line number Diff line number Diff line change
1
+ all : build
2
+
3
+ # ######################
4
+ # # BUILD
5
+
6
+ .PHONY : build
7
+ build :
8
+ forge build
9
+
10
+ .PHONY : clean
11
+ clean :
12
+ forge clean
13
+
14
+ .PHONY : build-prod
15
+ build-prod : clean
16
+ docker build --target foundry-export -f Dockerfile -o out .
17
+
18
+ # ######################
19
+ # # TESTS
20
+
21
+ .PHONY : check-format
22
+ check-format :
23
+ forge fmt --check
24
+
25
+ .PHONY : fix-format
26
+ fix-format :
27
+ forge fmt
28
+
29
+ .PHONY : test
30
+ test :
31
+ forge test -vvv
32
+
33
+ # Verify that the contracts do not include PUSH0 opcodes
34
+ test-push0 :
35
+ forge build --extra-output evm.bytecode.opcodes
36
+ @if grep -qr --include \* .json PUSH0 ./evm/out; then echo " Contract uses PUSH0 instruction" 1>&2 ; exit 1; else echo " PUSH0 Verification Succeeded" ; fi
Original file line number Diff line number Diff line change 1
1
[profile .default ]
2
+ solc_version = " 0.8.23"
3
+ optimizer = true
4
+ optimizer_runs = 200
5
+ via_ir = false
6
+ evm_version = " london"
2
7
src = " src"
3
8
out = " out"
4
9
libs = [" lib" ]
10
+ fs_permissions = [{ access = " read" , path = " ./test/payloads" }]
5
11
6
- # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
12
+ [profile .prod ]
13
+ via_ir = true
14
+ fs_permissions = [{access = " read" , path = " ./cfg/" }]
15
+
16
+ [fmt ]
17
+ line_length = 100
18
+ multiline_func_header = " params_first"
19
+ # wrap_comments = true
20
+
21
+ # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
You can’t perform that action at this time.
0 commit comments