-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MP-1712. Improve ci/cd. * Improve schema generation. Fix cargo make tasks naming. * Bump osmosis deps. * Use 0.16 deps to be compatible. * Ignore correct files from coverage. * Use cache for deps in github pipelines.
- Loading branch information
Showing
12 changed files
with
310 additions
and
362 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Artifacts | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
|
||
# selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key | ||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install cargo make | ||
uses: davidB/rust-cargo-make@v1 | ||
|
||
- name: Compile contracts to wasm | ||
run: cargo make rust-optimizer |
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,50 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
env: | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
# Directory with wasm files used by `tests` | ||
ARTIFACTS_DIR_PATH: 'target/wasm32-unknown-unknown/release' | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
profile: minimal | ||
override: true | ||
components: llvm-tools-preview | ||
|
||
# selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key | ||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install cargo make | ||
uses: davidB/rust-cargo-make@v1 | ||
|
||
# artifacts used by tests | ||
- name: Compile workspace | ||
run: cargo make build | ||
|
||
- name: Run test coverage | ||
run: cargo make coverage-lcov | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: target/coverage/lcov.info |
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,79 +1,52 @@ | ||
on: push | ||
|
||
name: Main | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
env: | ||
# Directory with wasm files used by `tests` | ||
ARTIFACTS_DIR_PATH: 'target/wasm32-unknown-unknown/release' | ||
RUST_BACKTRACE: 1 | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
|
||
test: | ||
name: Test Suite | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.18.0' # required by osmosis-testing | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
target: wasm32-unknown-unknown | ||
components: llvm-tools-preview | ||
override: true | ||
|
||
- name: Install cargo make | ||
uses: davidB/rust-cargo-make@v1 | ||
|
||
- name: Compile workspace | ||
run: cargo make build | ||
|
||
- name: Run tests | ||
run: cargo make test | ||
|
||
# FIXME: enable when testing directories work as expected | ||
#- name: Run test coverage | ||
# run: cargo make coverage | ||
|
||
#- name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v3.1.1 | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
# fail_ci_if_error: false | ||
# files: target/lcov.info | ||
|
||
lints: | ||
name: Lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '>=1.18.0' # required by osmosis-testing | ||
|
||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
components: rustfmt, clippy | ||
profile: minimal | ||
override: true | ||
|
||
# selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key | ||
- name: Cache dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Install cargo make | ||
uses: davidB/rust-cargo-make@v1 | ||
|
||
- name: Check formatting | ||
- name: Format | ||
run: cargo make fmt | ||
|
||
- name: Clippy check | ||
- name: Clippy | ||
run: cargo make clippy | ||
|
||
# fails if schemas changes not committed | ||
- name: Check schemas up-to-date | ||
run: | | ||
cargo make generate-all-schemas | ||
git diff --exit-code schemas | ||
- name: Audit dependencies | ||
run: | | ||
cargo install --locked cargo-audit | ||
cargo make audit |
Oops, something went wrong.