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 with Packit in GitHub CI using Fedora COPR as build service #1667
base: master
Are you sure you want to change the base?
Conversation
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.
Nice work! I'm happy to see CI working on Fedora.
|
||
jobs: | ||
- job: copr_build | ||
trigger: pull_request |
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'd be nice if I can trigger it when I push some codes to a branch. For example, I often push some code to the branches under check/
or review/
. I usually don't create a PR by myself.
Also I want to run different set of tests depending on the trigger type. For PR check, maybe it's enough run the tests on the latest Fedora only. For nightly test, it can run on most versions.
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.
Yes, it's possible to trigger builds by commits to specific branches:
https://packit.dev/docs/configuration/#packit-service-jobs
Example snippet for .packit.yml
from this page:
- job: copr_build
trigger: commit
branch: main
targets:
- centos-stream-8-x86_64
- centos-stream-9-x86_64
- fedora-all
So yes, depending on the branch, you can configure specific targets to be built.
I don't know or understand yet, where the builds will be linked so you can access them, but I assume that it just has to be tried, and then we'll find out.
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.
Is it also possible to trigger the build manually like from nightly tests?
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.
There seems to be a possiblitily run jobs on a daily basis. At least, there is a project for daily LLVM snapshot builds:
https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/
A likewise also interesting topic is the Fedora testing farm which can be also used thruogh Packit:
https://fedoramagazine.org/test-github-projects-with-github-actions-and-testing-farm/
For public users, the tests are run only by AWS instances, but it has a nice test results viewer:
https://docs.testing-farm.io/general/0.1/test-results.html
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.
Can these files live in the misc/
directory?
Hi @namhyung!
This PR adds the configuration to support using Fedora Packit for GitHub CI using Fedora COPR.
As a demonstration, please have a look at the Checks executed for this PR here:
In linux-tracing#3, to the right of:
-> click on the link "show all checks" to see all the checks, and scroll down the list of checks (of course it is configurable)
This PR provides this capability, when Fedora Packit (which is amed to help devs) is enabled for a given Repo,
it does nothing when Packit is not enabled.
What you get:
This page gives you a quick overview how it works: https://packit.dev (Quotes from it):
This describes how to enable the Packit Service: https://packit.dev/docs/guide/, in short:
An account at https://accounts.fedoraproject.org/ (you can just sign up) needs set your user name as his Github user.
The administrator of the repo (likely you), would need to "order" the free Packit-as-a-service on Github.
Then, using a special comment on a Github PR, you confirm that the user on accounts.fedoraproject.org should be used to run the builds,
Create a pull request for master and have fun ;-)
The used
uftrace.spec
unfortunately excludes a number of tests from the testsuite runs because they tended to fail in most build environments, but it keeps most tests and defines upper bounds for the number of fails, classified as differing, failing to build, non-zero exit status, etc. This reduction of number of fails can of course be omitted, and the numbers of tolerated fails would have to be raised to make the builds still succeed (or when figured out, moved into a separate check stage, but running all in one go has the benefit that in this way, the test reports are included in the RPM packages and can analysed and compared from there.)PS: Currently, some test suites fail differently in each build environment, so the limits are oriented at those build environments with the highest amount of failures and skipped tests in order to make the builds pass under normal circumstances.
But the good thing is that with this regressions can be noticed earlier (some seem to be between 0.13 and master):
This CI addition ensures that each merge into uftrace is also buildable for Fedora (CentOS Stream can be added too) and has (at least in the tests which are not excluded or skipped) if at all only a limited amount of regressions in any of the defined RPM build environments for these distributions.