Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove git diff action and fix contract-folder #686

Merged
merged 1 commit into from
Jul 22, 2024
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
8 changes: 5 additions & 3 deletions .github/workflows/lst_adapter_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ on:
paths:
- 'smart-contracts/contracts/lst-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-adapter-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/lst_adapter_osmosis.yml'
push:
branches:
- main
paths:
- 'smart-contracts/contracts/lst-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-adapter-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/lst_adapter_osmosis.yml'
workflow_dispatch:

jobs:
unit-test:
uses: ./.github/workflows/rust_basic.yml
with:
target: 'contract/lst-adapter-osmosis'
target: 'contracts/lst-adapter-osmosis'
8 changes: 5 additions & 3 deletions .github/workflows/lst_dex_adapter_osmosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ on:
paths:
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/lst_dex_adapter_osmosis.yml'
push:
branches:
- main
paths:
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/Cargo.toml'
- 'smart-contracts/contracts/lst-dex-adapter-osmosis/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/lst_dex_adapter_osmosis.yml'
workflow_dispatch:

jobs:
unit-test:
uses: ./.github/workflows/rust_basic.yml
with:
target: 'contract/lst-dex-adapter-osmosis'
target: 'contracts/lst-dex-adapter-osmosis'
10 changes: 7 additions & 3 deletions .github/workflows/merkle_incentives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ on:
paths:
- 'smart-contracts/contracts/merkle-incentives/Cargo.toml'
- 'smart-contracts/contracts/merkle-incentives/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/rust_test_tube.yml'
- '.github/workflows/merkle_incentives.yml'
push:
branches:
- main
paths:
- 'smart-contracts/contracts/merkle-incentives/Cargo.toml'
- 'smart-contracts/contracts/merkle-incentives/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/rust_test_tube.yml'
- '.github/workflows/merkle_incentives.yml'
workflow_dispatch:

jobs:
unit-test:
uses: ./.github/workflows/rust_basic.yml
with:
target: 'contract/merkle-incentives'
target: 'contracts/merkle-incentives'
test-tube:
uses: ./.github/workflows/rust_test_tube.yml
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/range_middleware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ on:
paths:
- 'smart-contracts/contracts/range-middleware/Cargo.toml'
- 'smart-contracts/contracts/range-middleware/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/range_middleware.yml'
push:
branches:
- main
paths:
- 'smart-contracts/contracts/range-middleware/Cargo.toml'
- 'smart-contracts/contracts/range-middleware/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/range_middleware.yml'
workflow_dispatch:

jobs:
unit-test:
uses: ./.github/workflows/rust_basic.yml
with:
target: 'contract/range-middleware'
target: 'contracts/range-middleware'
11 changes: 0 additions & 11 deletions .github/workflows/rust_basic.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: |
${{inputs.contract}}/**.rs
${{inputs.contract}}/Cargo.toml
- name: Install Rust
if: env.GIT_DIFF
uses: dtolnay/rust-toolchain@stable
- name: Restore dependencies
if: env.GIT_DIFF
uses: actions/cache/restore@v4
with:
path: |
Expand All @@ -33,14 +25,11 @@ jobs:
key: ${{ runner.os }}-cargo-$GITHUB_SHA
restore-keys: ${{ runner.os }}-cargo
- name: Rust lint
if: env.GIT_DIFF
run: RUSTFLAGS="-Dwarnings" cargo clippy --workspace -- -D warnings --A deprecated
working-directory: smart-contracts/${{ inputs.target }}
- name: Rust format check
if: env.GIT_DIFF
run: cargo fmt --all -- --check
working-directory: smart-contracts/${{ inputs.target }}
- name: Run unit-tests
if: env.GIT_DIFF
run: cargo unit-test
working-directory: smart-contracts/${{ inputs.target }}
8 changes: 5 additions & 3 deletions .github/workflows/token_burner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ on:
paths:
- 'smart-contracts/contracts/token-burner/Cargo.toml'
- 'smart-contracts/contracts/token-burner/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/token_burner.yml'
push:
branches:
- main
paths:
- 'smart-contracts/contracts/token-burner/Cargo.toml'
- 'smart-contracts/contracts/token-burner/**.rs'
- '.github/workflows/**.yml'
- '.github/workflows/rust_basic.yml'
- '.github/workflows/token_burner.yml'
workflow_dispatch:

jobs:
unit-test:
uses: ./.github/workflows/rust_basic.yml
with:
target: 'contract/token-burner'
target: 'contracts/token-burner'
Loading