Skip to content

Commit

Permalink
[CI] Run proptests only on main (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll authored Jul 23, 2024
1 parent f443574 commit 6257fcb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/cl_vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ on:
- 'smart-contracts/contracts/cl-vault/**.rs'
- 'smart-contracts/contracts/dex-router-osmosis/Cargo.toml'
- 'smart-contracts/contracts/dex-router-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/cl_vault.yml'
- '.github/workflows/rust_basic.yml'
push:
branches:
- main
Expand All @@ -18,7 +19,8 @@ on:
- 'smart-contracts/contracts/cl-vault/**.rs'
- 'smart-contracts/contracts/dex-router-osmosis/Cargo.toml'
- 'smart-contracts/contracts/dex-router-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/cl_vault.yml'
- '.github/workflows/rust_basic.yml'
workflow_dispatch:

jobs:
Expand All @@ -31,3 +33,4 @@ jobs:
with:
contract: 'cl-vault'
dex_router_osmosis: true
prop_test: ${{ github.ref == 'refs/heads/main' }}
8 changes: 7 additions & 1 deletion .github/workflows/rust_test_tube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ on:
type: string
dex_router_osmosis:
required: false
default: false
type: boolean
prop_test:
required: false
type: boolean

jobs:
Expand Down Expand Up @@ -37,6 +39,10 @@ jobs:
working-directory: smart-contracts/contracts/dex-router-osmosis
- name: Run test-tube tests
run: cargo test-tube
working-directory: smart-contracts/contracts/${{ inputs.contract }}
- name: Run prop-test
if: inputs.prop_test
run: cargo prop-test
env:
PROPTEST_CASES: 10
working-directory: smart-contracts/contracts/${{ inputs.contract }}
Expand Down
3 changes: 2 additions & 1 deletion smart-contracts/contracts/cl-vault/.cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
wasm = "build --release --lib --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --bin schema"
test-tube = "test --test * --features test-tube -- --include-ignored --test-threads=1"
test-tube = "test --test * --features test-tube -- --test-threads=1"
prop-test = "test tests::proptest::test_complete_works --lib -- --test-threads=1 --exact"
test-tube-build = "build --release --lib --target wasm32-unknown-unknown --target-dir ./test-tube-build"

0 comments on commit 6257fcb

Please sign in to comment.