-
Notifications
You must be signed in to change notification settings - Fork 27
Add basic CI #18
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
Add basic CI #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" |
| 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 | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| toolchain: 1.65.0 | ||
| command: test | ||
| args: --workspace | ||
| env: | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| - name: Compile WASM contract | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 (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 | ||
There was a problem hiding this comment.
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