-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add reusable workflow for test-tube tests
- Loading branch information
Showing
8 changed files
with
84 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
name: Build Quasar | ||
name: Build Quasar (Go) | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- fix/* | ||
paths-ignore: | ||
- 'smart-contracts/**' | ||
push: | ||
branches: | ||
- main | ||
- fix/* | ||
paths-ignore: | ||
- 'smart-contracts/**' | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
# This workflow makes x86_64 binaries for linux. | ||
# TODO: add darwin later | ||
jobs: | ||
build-go: | ||
name: quasar-${{ matrix.targetos }}-${{ matrix.arch }} | ||
|
@@ -54,78 +56,4 @@ jobs: | |
if: env.GIT_DIFF | ||
with: | ||
name: quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} | ||
path: build/quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} | ||
build-rust: | ||
name: quasar-contracts-${{ matrix.targetos }}-${{ matrix.arch }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
arch: [ amd64 ] | ||
targetos: [ linux ] | ||
permissions: | ||
contents: write | ||
actions: write | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Get git diff | ||
uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.rs | ||
Makefile | ||
.github/workflows/build.yml | ||
- name: Install just via cargo | ||
if: env.GIT_DIFF | ||
run: cargo install just | ||
- name: Build smart contracts | ||
if: env.GIT_DIFF | ||
run: | | ||
cd smart-contracts | ||
just workspace-optimize | ||
- uses: actions/upload-artifact@v3 | ||
if: env.GIT_DIFF | ||
with: | ||
name: smart-contracts | ||
path: | | ||
smart-contracts/artifacts/basic_vault.wasm | ||
smart-contracts/artifacts/lp_strategy.wasm | ||
smart-contracts/artifacts/cl_vault.wasm | ||
smart-contracts/artifacts/merkle_incentives.wasm | ||
smart-contracts/artifacts/dex_router_osmosis.wasm | ||
smart-contracts/artifacts/lst_adapter_osmosis.wasm | ||
test-test-tube: | ||
runs-on: ubuntu-latest | ||
needs: build-rust | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Get git diff | ||
uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.rs | ||
Makefile | ||
.github/workflows/build.yml | ||
- name: Download contracts | ||
if: env.GIT_DIFF | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: | ||
smart-contracts | ||
|
||
- name: Install Rust | ||
if: env.GIT_DIFF | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Move smart contracts | ||
if: env.GIT_DIFF | ||
run: | | ||
find . -name "*.wasm" -exec bash -c 'file="{}"; contract_name=$(basename "$file" .wasm); dir_name=$(echo "$contract_name" | sed "s/_/-/g"); mkdir -p "smart-contracts/contracts/$dir_name/test-tube-build/wasm32-unknown-unknown/release"; mv "$file" "smart-contracts/contracts/$dir_name/test-tube-build/wasm32-unknown-unknown/release/$contract_name.wasm"' \; | ||
- name: Run test-tube tests | ||
if: env.GIT_DIFF | ||
run: cd smart-contracts && cargo test -- --include-ignored --test-threads=1 | ||
env: | ||
PROPTEST_CASES: 10 | ||
path: build/quasarnoded-${{ matrix.targetos }}-${{ matrix.arch }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Test merkle incentives | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'smart-contracts/contracts/merkle-incentives/**' | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
unit-test: | ||
uses: ./.github/workflows/rust_basic.yml | ||
with: | ||
contract: 'merkle-incentives' | ||
test-tube: | ||
uses: ./.github/workflows/rust_test_tube.yml | ||
with: | ||
contract: 'merkle-incentives' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Test Tube | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
contract: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test-tube: | ||
runs-on: ubuntu-latest | ||
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: | | ||
~/.cargo | ||
~/go | ||
**/target | ||
key: ${{ runner.os }}-cargo-$${{ hashFiles('smart-contracts/Cargo.lock') }} | ||
restore-keys: ${{ runner.os }}-cargo | ||
- name: Build test-tube tests | ||
if: env.GIT_DIFF | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters