-
Notifications
You must be signed in to change notification settings - Fork 10
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
Open
3v1n0
wants to merge
3
commits into
ubuntu:main
Choose a base branch
from
3v1n0:debian-packaging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: Build debian packages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
DEBIAN_FRONTEND: noninteractive | ||
DEBCONF_NONINTERACTIVE_SEEN: true | ||
TERM: dumb | ||
|
||
jobs: | ||
build-deb-package: | ||
name: Build ubuntu package | ||
runs-on: ubuntu-latest | ||
outputs: | ||
run-id: ${{ github.run_id }} | ||
pkg-name: ${{ env.PKG_NAME }} | ||
pkg-version: ${{ env.PKG_VERSION }} | ||
|
||
steps: | ||
- name: Checkout authd code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build debian packages and sources | ||
uses: 3v1n0/desktop-engineering/gh-actions/common/build-debian@build-deb-docker | ||
with: | ||
docker-image: ubuntu:devel | ||
extra-source-build-deps: | | ||
ca-certificates | ||
git | ||
|
||
run-lintian: | ||
name: Run lintian | ||
needs: build-deb-package | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: ubuntu:devel | ||
|
||
steps: | ||
- name: Prepare container | ||
run: | | ||
set -eu | ||
|
||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90aptyes | ||
apt update | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
run-id: ${{ needs.build-deb-package.outputs.run-id }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt install lintian | ||
|
||
- name: Create test user | ||
run: | | ||
apt install adduser | ||
adduser --disabled-password --gecos "" tester | ||
chown tester:tester . -R | ||
|
||
- name: Run lintian on source package | ||
run: | | ||
runuser -u tester -- lintian --pedantic --fail-on error \ | ||
./*-debian-source/${{ needs.build-deb-package.outputs.pkg-name }}_${{ needs.build-deb-package.outputs.pkg-version }}_source.changes | ||
|
||
- name: Run lintian on binary packages | ||
run: | | ||
runuser -u tester -- lintian --pedantic --fail-on error \ | ||
./*-debian-packages/*_${{ needs.build-deb-package.outputs.pkg-version }}_*.deb | ||
|
||
run-autopkgtests: | ||
name: Run autopkgtests | ||
needs: build-deb-package | ||
runs-on: ubuntu-latest | ||
|
||
container: | ||
image: ubuntu:devel | ||
|
||
steps: | ||
- name: Prepare container | ||
run: | | ||
set -eu | ||
|
||
echo 'APT::Get::Assume-Yes "true";' > /etc/apt/apt.conf.d/90aptyes | ||
apt update | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
run-id: ${{ needs.build-deb-package.outputs.run-id }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
apt install autopkgtest | ||
|
||
- name: Create test user | ||
run: | | ||
apt install adduser | ||
adduser --disabled-password --gecos "" tester | ||
|
||
- name: Run autopkgtests | ||
run: | | ||
mv -v ./*-debian-source/* . | ||
mv -v ./*-debian-packages/* . | ||
autopkgtest --apt-pocket proposed --apt-upgrade --no-built-binaries --user=tester \ | ||
*_${{ needs.build-deb-package.outputs.pkg-version }}*.deb \ | ||
${{ needs.build-deb-package.outputs.pkg-name }}_${{ needs.build-deb-package.outputs.pkg-version }}_source.changes -- null |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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'm not a big fan of having this running on every single PR and push to main, tbh. I think it's better to trigger this only if there were any changes on
debian/
, otherwise it will increase our CI time to run even more for little gain.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.
Eh... I would agree on that, if it wouldn't that test may fail in different conditions, and having it tested in a properly isolated testbed is the way.
I think also @didrocks agree'd as per #130 (comment).
However, one thing we could do is limit to changes on
**/**_test.go
file maybe?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.
Not sure if there's a way in github to run only a workflow when a PR is approved? As that would be a way to prevent problems to hit to main without having to test all the PR's from the very first moment.
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.
You can add a job that relies on the completion of another one by setting the
needs:
field, but I still think that this is not something we need to constantly watch for.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, I'm afraid this kind of action might give users the wrong impression that the code in
main
is always "ready to use" when, in reality, this kind of project relies a lot on manual tests to ensure none of our dependencies regressed.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.
No, well that's not the point IMHO but at the same it's useful for testing having packages ready all the time.
But well, if someone think that, then is wrong as it would be wrong in any other project doing nightly builds.
However, I can see if can change this to reduce the scope of its action. I guess we'll do this after FF though since this still depends on canonical/desktop-engineering#28
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.
This is a CI related PR, so it can definitely wait and be done after FF.
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.
Yeah, the reason for that was to get this early to be confident on uploading things working stuff to the distro, but we can still append these commits to temporary branches to check things for now.