-
Notifications
You must be signed in to change notification settings - Fork 97
130 lines (109 loc) · 3.62 KB
/
Copy pathevm.yml
File metadata and controls
130 lines (109 loc) · 3.62 KB
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
name: EVM CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
tags:
- 'v*\+evm'
env:
FOUNDRY_PROFILE: ci
# Cancel in-progress runs on new commits to same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
defaults:
run:
working-directory: ./evm
jobs:
# Ensure contract version constants stay in sync and are bumped after release
check-version:
name: Check version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
./scripts/check-version --tag "${GITHUB_REF_NAME}"
else
# If this exact commit is already tagged as an EVM release, verify the
# tag matches. Otherwise, require a version bump only when src/ changed.
head_evm_tag="$(git tag --points-at HEAD --list 'v*+evm' | head -n1)"
if [[ -n "${head_evm_tag}" ]]; then
./scripts/check-version --tag "${head_evm_tag}"
elif git diff --quiet "origin/${GITHUB_BASE_REF:-main}...HEAD" -- src/; then
echo "No EVM source changes; skipping version-bump requirement"
./scripts/check-version
else
./scripts/check-version --require-newer-than-latest-tag
fi
fi
# Fast lint check - no build needed, runs in parallel with other jobs
lint:
name: forge fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0
with:
version: v1.5.0
- name: Run Forge fmt
run: make lint
working-directory: ./evm
# Build and test
test:
name: forge test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0
with:
version: v1.5.0
- name: Run Forge build
run: make push0-test
- name: Run Forge tests
run: make forge-test
- name: Run size test
run: make size-test
- name: Build with via-ir for cache
run: forge build --via-ir
- name: Save forge build cache
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
evm/out
evm/cache
key: forge-via-ir-${{ hashFiles('evm/src/**/*.sol', 'evm/script/**/*.sol', 'evm/foundry.toml') }}
echidna:
name: echidna
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0
with:
version: v1.5.0
- name: Run Forge build
run: make build
working-directory: evm
- name: Run Echidna
uses: crytic/echidna-action@f7e374e42bf7131f7307a92f5549ed6b2fd17c9d # v2
with:
files: ./evm/echidna
config: evm/echidna.yaml
echidna-version: v2.3.0