-
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
Conversation
de13838 to
1657c7f
Compare
Closes #15
1657c7f to
d5e2c75
Compare
maurolacy
left a comment
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.
LGTM.
ethanfrey
left a comment
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.
Can you please not use nightly in CI.
Let's use a fixed stable version, like we will use for really developing and compiling them.
.github/workflows/basic.yml
Outdated
| - name: Checkout sources | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Install latest nightly toolchain |
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.
Let's not use nightly.
Code should work with some well-defined version of Rust and only use nightly briefly if we really need some feature that is about to be stabilized.
I think MSRV for cosmwasm is 1.65. Latest release is 1.70.
We can use anything between that (inclusive) for this CI. But make it explicit and then we make a PR to update.
Sometimes newer version flag lint errors earlier ones didn't and randomly breaking CI (when a new rust docker image is pushed) is not so much fun.
.github/workflows/basic.yml
Outdated
| - name: Run tests | ||
| uses: actions-rs/cargo@v1 | ||
| with: | ||
| toolchain: nightly |
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.
I would remove toolchain: nightly everywhere and put whichever version we need. I think just stable
| target: wasm32-unknown-unknown | ||
| override: true | ||
|
|
||
| - name: Run tests |
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
| env: | ||
| RUST_BACKTRACE: 1 | ||
|
|
||
| - name: Compile WASM contract |
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: 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)
.github/workflows/basic.yml
Outdated
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: nightly |
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.
How about stable (to match the name).
Ideally use a fixed tag, so CI doesn't break when new stable comes out
ethanfrey
left a comment
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.
Great changes.
Question for future: can we put 1.65.0 in some variable for reuse?
Closes #15