Skip to content

Commit

Permalink
CI/build-deb: Use a matrix to run package builds in latest LTS and devel
Browse files Browse the repository at this point in the history
Those are so far the targets we care, so let's build and test packages
in both scenarios
  • Loading branch information
3v1n0 committed Dec 19, 2024
1 parent 412f17d commit 4c57921
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/build-deb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,24 @@ on:
pull_request:

env:
UBUNTU_VERSION: devel
UBUNTU_VERSIONS: '["latest", "devel"]'

jobs:
define-matrix:
runs-on: ubuntu-latest
outputs:
ubuntu-versions: ${{ env.UBUNTU_VERSIONS }}
steps:
- run: 'true'

build-deb-package:
name: Build ubuntu package
runs-on: ubuntu-latest
needs: define-matrix
strategy:
fail-fast: false
matrix:
ubuntu-version: ${{ fromJSON(needs.define-matrix.outputs.ubuntu-versions) }}
outputs:
run-id: ${{ github.run_id }}
pkg-name: ${{ env.PKG_NAME }}
Expand All @@ -27,7 +39,7 @@ jobs:
- name: Build debian packages and sources
uses: canonical/desktop-engineering/gh-actions/common/build-debian@main
with:
docker-image: ubuntu:${{ env.UBUNTU_VERSION }}
docker-image: ubuntu:${{ matrix.ubuntu-version }}
extra-source-build-deps: |
ca-certificates
git
Expand All @@ -38,8 +50,14 @@ jobs:
run-autopkgtests:
name: Run autopkgtests
needs: build-deb-package
runs-on: ubuntu-latest
needs:
- define-matrix
- build-deb-package
strategy:
fail-fast: false
matrix:
ubuntu-version: ${{ fromJSON(needs.define-matrix.outputs.ubuntu-versions) }}

steps:
- name: Download artifacts
Expand All @@ -52,7 +70,7 @@ jobs:
uses: 3v1n0/desktop-engineering/gh-actions/common/run-autopkgtest@run-autopkgtests
# FIXME: ^^^
with:
lxd-image: ubuntu:${{ env.UBUNTU_VERSION }}
lxd-image: ubuntu:${{ matrix.ubuntu-version }}
source-changes: ${{ needs.build-deb-package.outputs.pkg-name }}_${{ needs.build-deb-package.outputs.pkg-version }}_source.changes
# FIXME: Use this when https://github.com/canonical/desktop-engineering/pull/58 is in!
# source-changes: ${{ needs.build-deb-package.outputs.pkg-src-changes }}

0 comments on commit 4c57921

Please sign in to comment.