-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Add support GitHub Actions #166
Conversation
function repo_install does not require a mutable reference
b72f25f
to
45cfb6e
Compare
The code changes are probably fine. The github actions stuff though I'll need some explanation of some of the bits. |
.github/workflows/rust.yml
Outdated
pull_request: | ||
push: | ||
branches: | ||
- master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Id prefer this on every branch. I don't always work on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll fix that.
.github/workflows/rust.yml
Outdated
|
||
container: | ||
image: archlinux:base-devel | ||
options: --privileged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do and why is it needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for using archlinux instead of ubuntu (default linux container)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me without it at https://github.com/Morganamilo/alpm.rs/blob/master/.github/workflows/alpm.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, I apologize for not immediately thinking to do so :(
.github/workflows/rust.yml
Outdated
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Rust toolchain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to just use pacman here. Less complex and has the added benefit of also testing paru compiles with the version of rust in the repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to rust from archlinux
.github/workflows/rust.yml
Outdated
- /sys/fs/cgroup:/sys/fs/cgroup | ||
|
||
steps: | ||
- name: Install libclang (needed by clippy) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clippy does not need clang afaik where did you get that from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
.github/workflows/rust.yml
Outdated
|
||
steps: | ||
- name: Install libclang (needed by clippy) | ||
run: sudo pacman --noconfirm -Syy clang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't -Sy or -Syy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cache has been removed from the archive images archive.
warning: database file for 'core' does not exist (use '-Sy' to download)
warning: database file for 'extra' does not exist (use '-Sy' to download)
warning: database file for 'community' does not exist (use '-Sy' to download)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then use -Syu to avoid a partial upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, After installing rust from the official repository, the clang was not required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also forgot to mention, isn't the container running as root? the sudos shouldn't be needed right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes. Removed.
.github/workflows/rust.yml
Outdated
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: #--all-features (TODO: fix all features build) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't just blindly test all features. There needs to be a separate test for git and non git builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I'll do it a little later.
579c111
to
a2fe74a
Compare
@Morganamilo small question: do you need the build badge in the README.md? |
ce7b03a
to
699faff
Compare
Not really, the commit already shows the ci status. |
So far done: * cargo audit (audir rust vulnerabilities) * cargo test * cargo clippy * cargo fmt
699faff
to
12b3c00
Compare
|
||
- uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also why is the secret key needed for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only needed for forked repos. I will remove it before change to "Ready for Review" state.
By the way, if you're interested in doing CI at all, It would be nice to get #83 solved. Yay does it with this https://github.com/Jguer/yay/blob/next/.github/workflows/multiarch-build.yml but I'm not really familiar with github actions or docker. |
Hey, any update ? |
This PR introduce:
The jobs use an ubuntu-latest image with an archlinux docker inside.
P.S. cargo clippy --all-features failed (alpm package failed)
TODO: