diff --git a/.github/workflows/build.yml b/.github/workflows/build_go.yml similarity index 96% rename from .github/workflows/build.yml rename to .github/workflows/build_go.yml index fbf6d1382..8aaf912b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build_go.yml @@ -1,4 +1,4 @@ -name: Build Quasar (Go) +name: Build (Go) on: pull_request: @@ -7,12 +7,14 @@ on: - fix/* paths-ignore: - 'smart-contracts/**' + - '**.md' push: branches: - main - fix/* paths-ignore: - 'smart-contracts/**' + - '**.md' workflow_dispatch: concurrency: diff --git a/.github/workflows/cl_vault.yml b/.github/workflows/cl_vault.yml index a622be662..82ab2e62f 100644 --- a/.github/workflows/cl_vault.yml +++ b/.github/workflows/cl_vault.yml @@ -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 @@ -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 diff --git a/.github/workflows/dex_router_osmosis.yml b/.github/workflows/dex_router_osmosis.yml index 03b819eb5..34c6f3dd4 100644 --- a/.github/workflows/dex_router_osmosis.yml +++ b/.github/workflows/dex_router_osmosis.yml @@ -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 diff --git a/.github/workflows/lint_go.yml b/.github/workflows/lint_go.yml index 076b03136..06730d1e8 100644 --- a/.github/workflows/lint_go.yml +++ b/.github/workflows/lint_go.yml @@ -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: diff --git a/.github/workflows/lst_adapter_osmosis.yml b/.github/workflows/lst_adapter_osmosis.yml index e663392bd..e6857540c 100644 --- a/.github/workflows/lst_adapter_osmosis.yml +++ b/.github/workflows/lst_adapter_osmosis.yml @@ -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 diff --git a/.github/workflows/lst_dex_adapter_osmosis.yml b/.github/workflows/lst_dex_adapter_osmosis.yml index 62dd4162a..df32af122 100644 --- a/.github/workflows/lst_dex_adapter_osmosis.yml +++ b/.github/workflows/lst_dex_adapter_osmosis.yml @@ -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 diff --git a/.github/workflows/merkle_incentives.yml b/.github/workflows/merkle_incentives.yml index b59bb92f3..43a7b7814 100644 --- a/.github/workflows/merkle_incentives.yml +++ b/.github/workflows/merkle_incentives.yml @@ -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 diff --git a/.github/workflows/range_middleware.yml b/.github/workflows/range_middleware.yml index efa70d174..8c00b4f48 100644 --- a/.github/workflows/range_middleware.yml +++ b/.github/workflows/range_middleware.yml @@ -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 diff --git a/.github/workflows/rust_basic.yml b/.github/workflows/rust_basic.yml index b79ad1d9b..9627c22bc 100644 --- a/.github/workflows/rust_basic.yml +++ b/.github/workflows/rust_basic.yml @@ -17,8 +17,8 @@ jobs: uses: technote-space/get-diff-action@v6.1.2 with: PATTERNS: | - **/**.rs - **/Cargo.lock + ${{inputs.contract}}/**.rs + ${{inputs.contract}}/Cargo.toml - name: Install Rust if: env.GIT_DIFF uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/rust_test_tube.yml b/.github/workflows/rust_test_tube.yml index eef3eabbc..9e0cfe096 100644 --- a/.github/workflows/rust_test_tube.yml +++ b/.github/workflows/rust_test_tube.yml @@ -13,17 +13,9 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v3 - - name: Get git diff - uses: technote-space/get-diff-action@v6.1.2 - 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: | @@ -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 }} diff --git a/.github/workflows/test_go.yml b/.github/workflows/test_go.yml index 9c7e46915..8dd59c466 100644 --- a/.github/workflows/test_go.yml +++ b/.github/workflows/test_go.yml @@ -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: diff --git a/.github/workflows/token_burner.yml b/.github/workflows/token_burner.yml index 4be264919..635f912e9 100644 --- a/.github/workflows/token_burner.yml +++ b/.github/workflows/token_burner.yml @@ -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