From eb92509ed7d0e2032f8f74a37c7162274a1620ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 5 Dec 2023 17:52:42 +0100 Subject: [PATCH 1/3] CI: Add workflow to build debian package as part of build --- .github/workflows/build-deb.yaml | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/build-deb.yaml diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml new file mode 100644 index 000000000..092d9abdf --- /dev/null +++ b/.github/workflows/build-deb.yaml @@ -0,0 +1,33 @@ +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 From 5a57c4318d4a9bed17ebc05844f5bfb0eefcad55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Mon, 26 Feb 2024 06:08:20 +0100 Subject: [PATCH 2/3] CI: Add job to run lintian on built packages and sources --- .github/workflows/build-deb.yaml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 092d9abdf..6977aa34e 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -31,3 +31,44 @@ jobs: 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 From 0a233510328c0c8ee485e6d5ba348a7c5bd539c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Tue, 5 Dec 2023 21:04:16 +0100 Subject: [PATCH 3/3] CI: Add workflow to run autopkgtests on the previously built deb package Ensure that autopkgtests works with authd at every run --- .github/workflows/build-deb.yaml | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/build-deb.yaml b/.github/workflows/build-deb.yaml index 6977aa34e..011ea5586 100644 --- a/.github/workflows/build-deb.yaml +++ b/.github/workflows/build-deb.yaml @@ -72,3 +72,41 @@ jobs: 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