Skip to content

Commit

Permalink
[CI] Skip go linter and tests for smart contract changes (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
lubkoll authored Jul 18, 2024
1 parent 97fb2e3 commit f0b4845
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build Quasar (Go)
name: Build (Go)

on:
pull_request:
Expand All @@ -7,12 +7,14 @@ on:
- fix/*
paths-ignore:
- 'smart-contracts/**'
- '**.md'
push:
branches:
- main
- fix/*
paths-ignore:
- 'smart-contracts/**'
- '**.md'
workflow_dispatch:

concurrency:
Expand Down
34 changes: 30 additions & 4 deletions .github/workflows/cl_vault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/cl-vault/**'
- 'smart-contracts/contracts/cl-vault/Cargo.toml'
- 'smart-contracts/contracts/cl-vault/**.rs'
- 'smart-contracts/contracts/dex-router-osmosis/Cargo.toml'
- 'smart-contracts/contracts/dex-router-osmosis/**.rs'
push:
branches:
- main
Expand All @@ -17,6 +20,29 @@ jobs:
with:
target: 'contracts/cl-vault'
test-tube:
uses: ./.github/workflows/rust_test_tube.yml
with:
contract: 'cl-vault'
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo
~/go
**/target
key: ${{ runner.os }}-cargo-$${{ hashFiles('smart-contracts/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Build dex-router-osmosis
run: cargo test-tube-build
working-directory: smart-contracts/contracts/dex-router-osmosis
- name: Build cl-vault
run: cargo test-tube-build
working-directory: smart-contracts/contracts/cl-vault
- name: Run test-tube tests
run: cargo test-tube
env:
PROPTEST_CASES: 10
working-directory: smart-contracts/contracts/cl-vault
3 changes: 2 additions & 1 deletion .github/workflows/dex_router_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/dex-router-osmosis/**'
- 'smart-contracts/contracts/dex-router-osmosis/Cargo.toml'
- 'smart-contracts/contracts/dex-router-osmosis/**.rs'
push:
branches:
- main
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lint_go.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Lint Quasar code
name: Lint (Go)

on:
pull_request:
branches:
- main
paths-ignore:
- 'smart-contracts/**'
- '**.md'
push:
branches:
- main
paths-ignore:
- 'smart-contracts/**'
- '**.md'
workflow_dispatch:

concurrency:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lst_adapter_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/lst-adapter-osmosis/**'
- 'smart-contracts/contracts/lst-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-adapter-osmosis/**.rs'
push:
branches:
- main
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lst_dex_adapter_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/**'
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/**.rs'
push:
branches:
- main
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/merkle_incentives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/merkle-incentives/**'
- 'smart-contracts/contracts/merkle-incentives/Cargo.toml'
- 'smart-contracts/contracts/merkle-incentives/**.rs'
push:
branches:
- main
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/range_middleware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/range-middleware/**'
- 'smart-contracts/contracts/range-middleware/Cargo.toml'
- 'smart-contracts/contracts/range-middleware/**.rs'
push:
branches:
- main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.rs
**/Cargo.lock
${{inputs.contract}}/**.rs
${{inputs.contract}}/Cargo.toml
- name: Install Rust
if: env.GIT_DIFF
uses: dtolnay/rust-toolchain@stable
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/rust_test_tube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,9 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Get git diff
uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.rs
**/Cargo.lock
- name: Install Rust
if: env.GIT_DIFF
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
if: env.GIT_DIFF
uses: actions/cache@v4
with:
path: |
Expand All @@ -32,13 +24,9 @@ jobs:
**/target
key: ${{ runner.os }}-cargo-$${{ hashFiles('smart-contracts/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo
- name: Build test-tube tests
if: env.GIT_DIFF
- name: Build ${{ inputs.contract }}
run: cargo test-tube-build
working-directory: smart-contracts/contracts/${{ inputs.contract }}
- name: Run test-tube tests
if: env.GIT_DIFF
run: cargo test-tube
env:
PROPTEST_CASES: 10
working-directory: smart-contracts/contracts/${{ inputs.contract }}
8 changes: 7 additions & 1 deletion .github/workflows/test_go.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Test Quasar
name: Test (Go)

on:
pull_request:
branches:
- main
paths-ignore:
- 'smart-contracts/**'
- '**.md'
push:
branches:
- main
paths-ignore:
- 'smart-contracts/**'
- '**.md'
workflow_dispatch:

concurrency:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/token_burner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
paths:
- 'smart-contracts/contracts/token-burner/**'
- 'smart-contracts/contracts/token-burner/Cargo.toml'
- 'smart-contracts/contracts/token-burner/**.rs'
push:
branches:
- main
Expand Down

0 comments on commit f0b4845

Please sign in to comment.