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

Get CircleCI lint check check working, then pass tests #11

Merged
merged 4 commits into from
Apr 8, 2021

Conversation

carver
Copy link
Collaborator

@carver carver commented Apr 6, 2021

Fixes #3

Todo:

  • rustfmt
  • build check?
  • squash

@carver carver mentioned this pull request Apr 6, 2021
5 tasks
@carver
Copy link
Collaborator Author

carver commented Apr 6, 2021

There weren't any formatting errors to test against, but I temporarily pushed a commit with one to confirm that CI fails.

@carver carver requested a review from njgheorghita April 6, 2021 22:07
@carver
Copy link
Collaborator Author

carver commented Apr 6, 2021

After this, I'll actually start running the project tests (which seem to be failing!). Ah, I just didn't have an env variable set up

- Fix the circle CI image version: they wanted the config version
number, not the rust version.
- Install libssl-dev in OS to support openssl-sys cargo package install
- When referencing targets in the rust orb, must prefix with rust/
- Speed up CI by building debug instead of release (saves about 50s)
- Save target/ in cache to speed up build time
- Run rustfmt in CircleCI*

* The rust/format job runs `cargo fmt` which only modifies the files in
place, it doesn't actually fail or display the needed changes. So switch
it to `cargo fmt -- --check` which passes --check into rustfmt, and
causes CI to fail when formatting is broken (as desired).
@carver
Copy link
Collaborator Author

carver commented Apr 6, 2021

I didn't do anything manual with "Cargo.lock", just ran a cargo update.

Copy link
Collaborator

@njgheorghita njgheorghita left a comment

Choose a reason for hiding this comment

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

Looks good! Are there clippy settings somewhere that I'm missing? I've run clippy locally and not able to reproduce the linting warnings. Not sure why, but as long as it's being caught in ci then it's probably something wrong with my local setup that I'll sus out eventually

jobs:
lint-build-test:
description: |
Check linting with Clippy, then build the crate.
Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick ... then build the crate and run tests.

@carver
Copy link
Collaborator Author

carver commented Apr 7, 2021

Are there clippy settings somewhere that I'm missing?

Maybe the version of rust (v1.51.0)? The VM seems to install clippy normally: rustup component add clippy.

@carver carver merged commit 69d0d46 into master Apr 8, 2021
@carver carver deleted the circle-ci-test-branch branch April 8, 2021 04:00
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 CI
2 participants