-
Notifications
You must be signed in to change notification settings - Fork 11
60 lines (49 loc) · 1.64 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
name: Run unit tests
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
workflow_dispatch:
jobs:
unit-tests:
name: Unit Tests
runs-on: buildjet-16vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Check formatting
run: |
forge fmt --check
- name: Regenerate Contracts
run: |
python src/blocks/poseidon/poseidon-contract-gen.py src/blocks/poseidon/neptune-constants-U24-pallas.json PoseidonU24Pallas > src/blocks/poseidon/PoseidonNeptuneU24pallas.sol
python src/blocks/poseidon/poseidon-contract-gen.py src/blocks/poseidon/neptune-constants-U24-vesta.json PoseidonU24Vesta > src/blocks/poseidon/PoseidonNeptuneU24vesta.sol
- name: Run forge fmt on re-generated contracts
run: |
forge fmt
- name: Check discrepancies
run: |
if [[ `git status --porcelain` ]]; then
echo "There are discrepancies between the repository and the source. Please ensure the contracts are up to date."
exit 1
fi
- name: Run Forge build
run: |
forge --version
forge build
- name: Run Forge tests
run: |
forge test -vvv
- name: Get sizes of compiled contracts
run: |
forge --version
forge build --sizes || true