CI: Build debian packages and run autopackage tests#130
CI: Build debian packages and run autopackage tests#1303v1n0 merged 9 commits intocanonical:mainfrom
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.09% -0.34%
==========================================
Files 83 96 +13
Lines 8689 9603 +914
Branches 74 74
==========================================
+ Hits 7250 7980 +730
- Misses 1111 1239 +128
- Partials 328 384 +56 ☔ View full report in Codecov by Sentry. |
e92325b to
f2aa14a
Compare
9df4ea2 to
7281cd3
Compare
There was a problem hiding this comment.
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 canonical/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: canonical/authd#130 (e.g. https://github.com/ubuntu/authd/actions/runs/8044158864) UDENG-2439
95bab82 to
032a1f9
Compare
f2aecf5 to
dee7b3a
Compare
denisonbarbosa
left a comment
There was a problem hiding this comment.
Thanks for handling this!
dee7b3a to
c386833
Compare
didrocks
left a comment
There was a problem hiding this comment.
I have a couple of questions/notes/requests. Once you are done merging with the other PR on the desktop-engineering repo, we can have a look at this together :)
Ensure that autopkgtests works with authd at every run
c386833 to
bc3c687
Compare
Uniform the same code that we've in debian rules with debian tests
bc3c687 to
256957a
Compare
Those are so far the targets we care, so let's build and test packages in both scenarios
69da712 to
e5b42a8
Compare
didrocks
left a comment
There was a problem hiding this comment.
One last comment to add I think before we release. Looks good otherwise!
As per lintian report
Thanks lintian!
Newer versions require new cargo that is not in noble, so we don't try to use the newest version. Even though using a bit more advanced matrix we could do that...
c005292 to
0642fbb
Compare
|
@didrocks sorry, I had to re-iterate since I noticed that indeed the So I re-implemented it myself: https://github.com/ubuntu/authd/compare/c0052923fc0b17f645abe0e2d79beed3877d1409..0642fbb04e3be78ace0057a8654c5bf58d4b5110 |
Add a workflow to build debian packages and run autopkgtests.
Requires: canonical/desktop-engineering#58
UDENG-2343