besok / jsonpath-rust

Support for json-path in Rust
https://crates.io/crates/jsonpath-rust
MIT License
104 stars 27 forks source link

Add github actions #32

Closed theredfish closed 1 year ago

theredfish commented 1 year ago

To help with test coverage (#2) it is first important to automate this process for pull requests and also the main branch.

This commit adds a couple of jobs to run with github actions, the minimal CI requirements. A couple of fixes have been applied following the warnings returned by clippy. Most of them were trivial (like clone calls).

Because of the proc macro json_path_value, it was necessary to allow globally #![allow(clippy::vec_init_then_push)] (#!). This is not really convenient as it will certainly disable it for the rest of the library. Unfortunately this rule can't be added to the macro itself. It is triggered because of the use of a mutable vector, clippy doesn't see the expansion of the iterator over $v.

Formatting was also fixed but depending on the maintainer opinion it might be reverted for this commit in order to clean the diff and can be let for a subsequent PR.

theredfish commented 1 year ago

CI successfully run there: https://github.com/theredfish/jsonpath-rust/actions/runs/4375476892

Not sure about this repo. First time contributor, PR from fork or repo settings might block the CI to run?

besok commented 1 year ago

Hi @theredfish! Thank you for this PR. That is awesome.

theredfish commented 1 year ago

Not sure why the CI doesn't run though. Maybe some settings are necessary?

besok commented 1 year ago

Let me check

besok commented 1 year ago

Allow me to clarify the guess: it expects a push to the branch main but here the default branch is 'master'. Can it be a problem?

besok commented 1 year ago

I will try to rename the main branch

besok commented 1 year ago

Added the following pr and the checks kicked off. Marvelous!

theredfish commented 1 year ago

Oh sorry :) based the PR on my repo configs and I'm using main - definitely the issue there for this branch ! Glad to know it's now running!

besok commented 1 year ago

Yes, thanks a million. And at long last, I have changed the name of the main branch :) (Always supposed to do it but did not have enough time :))