-
Notifications
You must be signed in to change notification settings - Fork 13
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: Build debian packages and run autopackage tests #130
base: main
Are you sure you want to change the base?
Conversation
1a4eecc
to
aef2d42
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #130 +/- ##
==========================================
- Coverage 83.43% 83.18% -0.26%
==========================================
Files 83 87 +4
Lines 8689 8771 +82
Branches 74 74
==========================================
+ Hits 7250 7296 +46
- Misses 1111 1143 +32
- Partials 328 332 +4 ☔ View full report in Codecov by Sentry. |
e92325b
to
f2aa14a
Compare
9df4ea2
to
7281cd3
Compare
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 is a lot of assumptions on that PR, in particular in which distro to runs. Also, the containers in polluted with preparing the build package and end up having network connection when building it, which is not what a real ppa or builder is doing.
I think it will be better to reuse https://github.com/canonical/desktop-engineering/blob/main/gh-actions/common/build-debian/action.yml, amend it for anything needed without extending too much complexity. Please check with @EduardGomezEscandell who is the primary author.
Some of the changes that can be made for instance it to not rely on
- name: Build package
uses: jtdor/build-deb-action@v1
For instance, which should be easy enough to do.
That way, we can decide on which releases to build and ensure we have something closer to a real build environement. Adding autopkgtests as a separate action is interesting there too.
Consider this was done as a quick thing to test #120 (and actually caught few issues during the final testing of that PR :)). So, there are assumptions but all depending on variables, so ideally can be multiplexed to multiple jobs, although this was not a requirement yet.
Yeah, this has to be changed indeed.
However I was looking at the code of that action and I'm not sure how internet is prevented there too, since it seems that certificates are still installed. However I'll dig on that more further. |
Hi, thanks for taking a look :)
The action works in two phases, each in a separate container.
|
Something I don't like of that is that it's running the build process as root, which is what other builders do, but it should not be the case. I can probably patch that to fix this though. |
I've tried again using
It's quite weird since it does seems to run in the same environment.... And funny thing: there's no relevant difference in source packages as per So.... I'm not really sure what it is. I'll check in future, but I think that for now the safest way would just go with this option (once I address the comments on building based on the source and disabling internet access), instead of continuing living without a CI action that ensures we're still packaging authd properly. |
96257cf
to
dd5f794
Compare
Opening this again, even though now it's using canonical/desktop-engineering#28 |
dd5f794
to
0a23351
Compare
…s and add tests (#28) As underlined in ubuntu/authd#130 (comment) using `jtdor/build-deb-action` for building debian packages has some problems that are yet not clear, and it also does not seem to properly support building non-native packages. As per this, given that the code needed for handling the build inside a simpler docker container is quite small, I've moved the build to manual handling which allows us some more control over the steps at the cost of being a bit more verbose. As bonus: - We now only build as user (not the sources, since there's no much point) - All the network traffic is totally blocked for the builder user (not just HTTPS) - ~~`DEB_BUILD_OPTIONS` can be customized for special builds (e.g. `nocheck`)~~ - Version uses actual distro version I've added some commits from #22, but not included the lintian build yet (that I've ready [here](3v1n0@1b72205)) not to make this PR harder to check, but also because I think those could instead be part of another action to allow more parallelization when used. By doing this change, not only both test cases pass, but also authd is correctly built: ubuntu/authd#130 (e.g. https://github.com/ubuntu/authd/actions/runs/8044158864) UDENG-2439
95bab82
to
032a1f9
Compare
a6dbd9e
to
08386e0
Compare
…uild-source phase (#54) When building some packages we may need to prepare the build environment before preparing the source package, for example in some cases we may need to enable git access (to compute the package version or similar) or we may need to install tools that are used during debian source building that are not provided in the archive (such as rust crates, hello cargo-vendor-filterer!!). So instead of polluting this generic action with package-specific requirements, let's just make it support running a script that can do more advanced configurations in the docker instance that is used only during the source-preparation phase. This is required in order to be able to do a `cargo install --root=/usr cargo-vendor-filterer` to build the source package of rust programs as required by authd in ubuntu/authd#130 UDENG-2343
c5d815b
to
57e16b0
Compare
57e16b0
to
3cf7d05
Compare
It was based on the old code, and comments have been addressed.
f2aecf5
to
dee7b3a
Compare
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.
Thanks for handling this!
Ensure that autopkgtests works with authd at every run
Those are so far the targets we care, so let's build and test packages in both scenarios
Uniform the same code that we've in debian rules with debian tests
dee7b3a
to
c386833
Compare
Add a workflow to build debian packages and run autopkgtests.
Requires: canonical/desktop-engineering#58
UDENG-2343