Skip to content
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
3 changes: 3 additions & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[alias]
wasm = "build --release --lib --target wasm32-unknown-unknown"
wasm-debug = "build --lib --target wasm32-unknown-unknown"
76 changes: 76 additions & 0 deletions .github/workflows/basic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Based on https://github.com/actions-rs/example/blob/master/.github/workflows/quickstart.yml

on: [push, pull_request]

name: Basic Checks

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65.0
target: wasm32-unknown-unknown
override: true

- name: Run build
uses: actions-rs/cargo@v1
with:
toolchain: 1.65.0
command: build
args: --workspace
env:
RUST_BACKTRACE: 1

- name: Run tests
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, I often include a build phase before test.

If there are build errors and I run test, sometimes they seem to be reported twice.
I mean, it will fail regardless, but seems to give better output running them one after another

uses: actions-rs/cargo@v1
with:
toolchain: 1.65.0
command: test
args: --workspace
env:
RUST_BACKTRACE: 1

- name: Compile WASM contract
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this compiles whole workspace and not really good at checking contracts.

You could try something like https://github.com/CosmWasm/cw-plus/blob/main/.circleci/config.yml#L500-L519

If something gets imported with library feature flag, then it will show up as super small contract and missing entry points (where cosmwasm-check will fail). Nicer to have this fail on the PR that changes the imports, then right before a release.

(You can make those additions as a future PR)

uses: actions-rs/cargo@v1
with:
toolchain: 1.65.0
command: wasm
env:
RUSTFLAGS: "-C link-arg=-s"

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.65.0
override: true
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
toolchain: 1.65.0
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
toolchain: 1.65.0
command: clippy
args: --all-targets -- -D warnings
2 changes: 1 addition & 1 deletion contracts/native-staking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ library = []

[dependencies]
mesh-apis = { workspace = true }
mesh-native-staking-proxy = { workspace = true }
mesh-native-staking-proxy = { workspace = true, features = ["library"] }

sylvia = { workspace = true }
cosmwasm-schema = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion packages/apis/src/local_staking_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pub struct MaxSlashResponse {
pub max_slash: Decimal,
}


/// This is the interface to any local staking contract needed by the vault contract.
/// Users will need to use the custom methods to actually manage funds
#[interface]
Expand Down