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: Update CI and add Code Coverage #326

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

bconn98
Copy link
Collaborator

@bconn98 bconn98 commented Dec 4, 2023

No description provided.

@estk
Copy link
Owner

estk commented Dec 4, 2023

Action-rs is archived. Suggest dtolnays action. Check out our situation in trace4rs. I think that's the way to do it until we understand the future of actions-rs.

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 4, 2023

Treat this as a draft for now. I don't love that coverage has to go outside the PR.

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 4, 2023

Understood that action-rs was deprecated recently, but at this time I don't see a better alternative. I swapped the toolchain checkout though.

@estk
Copy link
Owner

estk commented Dec 4, 2023

Suggestions:
https://github.com/marketplace/actions/editorconfig-checker-action

https://github.com/dtolnay/rust-toolchain to install cargo, clippy fmt etc, then just:

    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - run: cargo test --all-features
      - run: cargo nextest --all-features
      - run: cargo clippy 
      - run: cargo fmt
      - etc etc

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 5, 2023

@estk Hmm seems that both our configs and the github actions configs aren't processed well by the editor config. Situations such as

- kind: threshold
  level: error

can't be processed properly because the indent level isn't a multiple of 4. Do we want to disable the check for yaml files? I can do some further research to see if we can work around it another way.

@estk
Copy link
Owner

estk commented Dec 5, 2023

I think we just need to fix the files.

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 5, 2023

I think we just need to fix the files.

@estk What I'm saying is that we would need to define a new configuration format (and the gitlab actions format) to fix the job. When I try to fix the indentation locally and run the unit tests I see the following:

---- config::raw::test::full_deserialize stdout ----
thread 'config::raw::test::full_deserialize' panicked at src/config/raw.rs:492:63:
called `Result::unwrap()` on an `Err` value: Error { kind: SCANNER, problem: "mapping values are not allowed in this context", problem_mark: Mark { line: 9, column: 18 } }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 5, 2023

@estk Looks like the final action is setting up the main repo for codecov.io which I can't do

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@bconn98 bconn98 changed the title ci: swap to action-rs and add gcovr ci: Update CI and add Code Coverage Dec 6, 2023
.github/workflows/audit.yml Outdated Show resolved Hide resolved
.github/workflows/coverage.yml Outdated Show resolved Hide resolved
.github/workflows/lint.yml Outdated Show resolved Hide resolved
LICENSE-APACHE Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/sample_config.yml Outdated Show resolved Hide resolved
src/config/raw.rs Outdated Show resolved Hide resolved
.github/workflows/audit.yml Outdated Show resolved Hide resolved
@bconn98 bconn98 force-pushed the workflow-update-and-gcovr branch 2 times, most recently from 42d6526 to b4d882c Compare December 6, 2023 22:27
@estk
Copy link
Owner

estk commented Dec 6, 2023

Hey @bconn98 , thanks for this, I think we're in the home stretch.

Regarding raw.rs

This will be a recurring problem for yaml files that are embedded in rust files. I think one way we can fix this permanently is to disable indentation checks for .rs files since it will already be covered by rustfmt.

[*.rs]
indent_size = false

See editorconfig-checker/editorconfig-checker#98

@bconn98
Copy link
Collaborator Author

bconn98 commented Dec 6, 2023

@estk done

@estk estk enabled auto-merge (squash) December 6, 2023 23:07
@estk estk merged commit b0a60a1 into estk:main Dec 6, 2023
11 checks passed
@bconn98 bconn98 deleted the workflow-update-and-gcovr branch December 22, 2023 02:52
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.

3 participants