Skip to content

Conversation

@JakeHartnell
Copy link
Contributor

Closes #15

@JakeHartnell JakeHartnell force-pushed the JakeHartnell/add-basic-ci branch 3 times, most recently from de13838 to 1657c7f Compare May 2, 2023 21:08
@JakeHartnell JakeHartnell force-pushed the JakeHartnell/add-basic-ci branch from 1657c7f to d5e2c75 Compare May 2, 2023 21:14
@JakeHartnell JakeHartnell marked this pull request as ready for review May 2, 2023 21:38
Copy link
Collaborator

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Collaborator

@ethanfrey ethanfrey left a 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.

- name: Checkout sources
uses: actions/checkout@v2

- name: Install latest nightly toolchain
Copy link
Collaborator

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.

- name: Run tests
uses: actions-rs/cargo@v1
with:
toolchain: nightly
Copy link
Collaborator

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
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

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/toolchain@v1
with:
profile: minimal
toolchain: nightly
Copy link
Collaborator

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

Copy link
Collaborator

@ethanfrey ethanfrey left a 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?

@ethanfrey ethanfrey merged commit d8782e2 into main May 3, 2023
@ethanfrey ethanfrey deleted the JakeHartnell/add-basic-ci branch May 3, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set up basic CI tests

4 participants