Skip to content
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

ci(circleci): move forward to CircleCI #49

Merged
merged 46 commits into from
Apr 28, 2021
Merged

ci(circleci): move forward to CircleCI #49

merged 46 commits into from
Apr 28, 2021

Conversation

clearloop
Copy link
Contributor

@clearloop clearloop commented Apr 27, 2021

Changes

Use CircleCI instead of Github actions

  • remove Github action test-code.yml
  • remove Github action docker.yml

Both of the above are squashed into the .circleci/config.yml now

Tests

Here is a testing CI on my fork clearloop/PINT

cached time spent
false ~20 mins
true ~10 mins

Issues

This PR moved the docker CI to CircleCI as well

  • It could be faster if we caching target/**/*, but it's not elegant
  • The clippy-check action of Github Actions is awesome but we'll lose it as we migrating to CircleCI

Closes #47

.circleci/config.yml Outdated Show resolved Hide resolved
- restore_cargo_package_cache
- run:
name: Run Tests
command: cargo test --all
Copy link
Contributor Author

Choose a reason for hiding this comment

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

#46

- restore_cargo_package_cache
- run:
name: clippy check
command: cargo clippy --all-targets
Copy link
Contributor Author

Choose a reason for hiding this comment

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

#46

@clearloop clearloop removed the needs review PR needs reviewing label Apr 27, 2021
clearloop and others added 13 commits April 28, 2021 01:54
* ci(cache): download sccahce binary directly

* ci(cach): sudo privilege to moving sccache binary

* ci(cache): use x86_64 sccache for the testing machine

* ci(cache): correct the url of sccache resource

* ci(sccache): clean the indent

* ci(security): requires reust_setup only

* ci(cache): use optional feature to run rust_setup conditionally

* ci(rust_setup): fix installing sccache

* ci(rust_setup): clean rust_setup

* ci(workflow): requires prefetch-cache

* ci(format): add rust_setup to format job

* ci(cache): add sccache to rust_setup

* ci(curl): fix the test script about downloading from links

* ci(condition): use if-else

* ci(prefetch): remove prefetch-crates

* ci(security): force installing rust-toolchain in job security

* ci(cache): use cache for security checking

* ci(security): remove os deps in security check

* ci(chore): uppercase job names
@clearloop
Copy link
Contributor Author

Finished, @mattsse , it could be faster if we cache path/to/target, but comparing with using sccache, it's not elegant indeed.

@clearloop clearloop added the needs review PR needs reviewing label Apr 28, 2021
@clearloop clearloop changed the title Move forward to CircleCI ci(circleci): move forward to CircleCI Apr 28, 2021
Copy link
Contributor

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

LGTM! however I've configured Circleci only a couple of time so I may have missed something.

- docker-publish-latest
filters:
tags:
only: /^v.*/
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this tag for?

Copy link
Contributor Author

@clearloop clearloop Apr 28, 2021

Choose a reason for hiding this comment

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

This will trigger publishing chainsafe/pint:x.x.x images everytime we tagging PINT with vx.x.x in github

IMAGE_NAME: chainsafe/pint
CARGO_AUDIT: /home/circleci/.cargo/bin/cargo-audit
RUSTC_WRAPPER: /home/circleci/.cargo/bin/sccache
RUSTC_TOOLCHAIN: nightly-2021-04-18
Copy link
Contributor

Choose a reason for hiding this comment

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

What's best practice for selecting nightly toolchain. lastest can be incomplete sometimes, right? Is there any downside of setting this randomly to a recent date like we do here?

Copy link
Contributor Author

@clearloop clearloop Apr 28, 2021

Choose a reason for hiding this comment

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

Using $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh follows installation with specified nightly channel will download the lastest nightly rust.

But I think using a specified version of rust can help us reduce the time modifying CI, substrate updates really fast, and sometimes the latest toolchains have bugs for compiling substrate.

For example, there was a big change in the rust compiler after 2020-10-05, substrate could not be compiled with the latest toolchains for months, and rust toolchains after 2020-03-13, have bugs compiling the debug info in wasm32-unknown-unknown target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved PR approved to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Github Actions don't have enough space storing our building cache
2 participants