-
Notifications
You must be signed in to change notification settings - Fork 6
90 lines (75 loc) · 2.38 KB
/
Copy pathcontracts-ci.yml
File metadata and controls
90 lines (75 loc) · 2.38 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
name: contracts-ci
on:
push:
branches: [main]
paths:
- 'contracts/**'
- '.github/workflows/contracts-ci.yml'
pull_request:
paths:
- 'contracts/**'
- '.github/workflows/contracts-ci.yml'
permissions:
contents: read
defaults:
run:
working-directory: contracts
jobs:
build-and-test:
name: Build, format-check, test, coverage
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0
with:
version: stable
- name: Install dependencies (forge install)
run: |
forge install --no-git foundry-rs/forge-std@v1.9.4
forge install --no-git OpenZeppelin/openzeppelin-contracts@v5.1.0
- name: Format check
run: forge fmt --check
- name: Build
run: forge build --sizes
- name: Run tests
run: forge test -vvv
- name: Coverage report
run: forge coverage --report summary --report lcov
continue-on-error: true
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: coverage-lcov
path: contracts/lcov.info
if-no-files-found: ignore
static-analysis:
name: Slither static analysis
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
submodules: recursive
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0
with:
version: stable
- name: Install dependencies (forge install)
run: |
forge install --no-git foundry-rs/forge-std@v1.9.4
forge install --no-git OpenZeppelin/openzeppelin-contracts@v5.1.0
- name: Run Slither
uses: crytic/slither-action@f197989dea5b53e986d0f88c60a034ddd77ec9a8 # v0.4.0
id: slither
with:
target: contracts/
slither-config: contracts/slither.config.json
fail-on: medium
slither-version: 0.10.4