Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Pull Request Integration

on:
pull_request:
branches:
- main

jobs:
verify_flows:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Check all flows have tests
run: |
python scripts/check_all_flows_have_test.py --allow-duplicate-tests

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: foundry-rs/setup-snfoundry@v3
with:
starknet-foundry-version: "0.49.0"
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.12.2"

- name: Install cairo-coverage
run: |
curl -L https://raw.githubusercontent.com/software-mansion/cairo-coverage/main/scripts/install.sh | sh

- name: Run test and coverage
run: scarb test -w --coverage

- uses: codecov/codecov-action@v5.3.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: workspace/apps/staking/contracts/coverage/coverage.lcov
fail_ci_if_error: true

- name: Check formatting
run: |
scarb fmt -w --check
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pprint import pprint

CONTRACTS_FOLDER: Path = (
Path(__file__).parent.parent.parent / "workspace/apps/staking/contracts"
Path(__file__).parent.parent / "workspace/apps/staking/contracts"
)

FLOWS_FILE: Path = CONTRACTS_FOLDER / "src/flow_test/flows.cairo"
Expand Down
5 changes: 5 additions & 0 deletions workspace/apps/staking/contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ scarb.workspace = true

[features]
fork_test = []

[profile.dev.cairo]
unstable-add-statements-functions-debug-info = true
unstable-add-statements-code-locations-debug-info = true
inlining-strategy = "avoid"