Skip to content

Commit 45cee2c

Browse files
ci: add PR CI
1 parent 7d2d010 commit 45cee2c

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Pull Request Integration
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
verify_flows:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.x'
19+
20+
- name: Check all flows have tests
21+
run: |
22+
python scripts/check_all_flows_have_test.py --allow-duplicate-tests
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: foundry-rs/setup-snfoundry@v3
30+
with:
31+
starknet-foundry-version: "0.49.0"
32+
- uses: software-mansion/setup-scarb@v1
33+
with:
34+
scarb-version: "2.12.2"
35+
36+
- name: Install cairo-coverage
37+
run: |
38+
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh
39+
40+
- name: Run test and coverage
41+
run: scarb test -w --coverage
42+
43+
- uses: codecov/codecov-action@v5.3.1
44+
with:
45+
token: ${{ secrets.CODECOV_TOKEN }}
46+
files: workspace/apps/staking/contracts/coverage/coverage.lcov
47+
fail_ci_if_error: true
48+
49+
- name: Check formatting
50+
run: |
51+
scarb fmt -w --check

scripts/staking/check_all_flows_have_test.py renamed to scripts/check_all_flows_have_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pprint import pprint
77

88
CONTRACTS_FOLDER: Path = (
9-
Path(__file__).parent.parent.parent / "workspace/apps/staking/contracts"
9+
Path(__file__).parent.parent / "workspace/apps/staking/contracts"
1010
)
1111

1212
FLOWS_FILE: Path = CONTRACTS_FOLDER / "src/flow_test/flows.cairo"

workspace/apps/staking/contracts/Scarb.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ scarb.workspace = true
3333

3434
[features]
3535
fork_test = []
36+
37+
[profile.dev.cairo]
38+
unstable-add-statements-functions-debug-info = true
39+
unstable-add-statements-code-locations-debug-info = true
40+
inlining-strategy = "avoid"

0 commit comments

Comments
 (0)