Skip to content

CI: Build debian packages and run autopackage tests #8

CI: Build debian packages and run autopackage tests

CI: Build debian packages and run autopackage tests #8

Workflow file for this run

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