From d8d28059b45ecb91fc63ec62c0645b84866b307a Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Wed, 15 Apr 2026 11:09:26 -0700 Subject: [PATCH] Build all snaps on all archs including dns; test on arm64 and amd64 --- .github/workflows/packaging_jobs.yml | 119 ++++++++++++++++++++++----- 1 file changed, 97 insertions(+), 22 deletions(-) diff --git a/.github/workflows/packaging_jobs.yml b/.github/workflows/packaging_jobs.yml index bdc552028..10b13fc72 100644 --- a/.github/workflows/packaging_jobs.yml +++ b/.github/workflows/packaging_jobs.yml @@ -71,29 +71,88 @@ jobs: uses: actions/download-artifact@v8.0.1 with: name: docker_${{ matrix.DOCKER_ARCH }} - github_token: "${{ secrets.GITHUB_TOKEN }}" path: "${{ github.workspace }}" - repo: "${{ github.repository }}" - name: Load Docker images run: set -e && docker load --input ${{ github.workspace }}/images.tar shell: bash - name: Run integration tests for Docker images run: set -e && tools/docker/test.sh ${{ env.dockerTag }} ${{ matrix.DOCKER_ARCH }} shell: bash - snaps_build: - runs-on: - - ubuntu-22.04 - timeout-minutes: 0 + gha_build: + name: Build ${{ matrix.build-for }} certbot snap + runs-on: ${{ matrix.build-on }} strategy: fail-fast: false matrix: - SNAP_ARCH: - - amd64 - - armhf - - arm64 + include: + - build-for: arm64 + build-on: ubuntu-24.04-arm + - build-for: amd64 + build-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6.0.2 + - uses: snapcore/action-build@v1.3.0 + id: build + with: + snapcraft-args: "--build-for=${{ matrix.build-for }}" + - name: Store snap artifact + uses: actions/upload-artifact@v7.0.0 + with: + name: snap-certbot-${{ matrix.build-for }} + path: ${{ steps.build.outputs.snap }} + generate_dns_list_matrix: + runs-on: ubuntu-latest + outputs: + dns-dirs: ${{ steps.set-dns-dirs.outputs.dns-dirs }} steps: - name: checkout uses: actions/checkout@v6.0.2 + - id: set-dns-dirs + run: | + DNS_NAMES=$(echo certbot-dns-* | jq -R -s -c 'split(" ")[:-1]') + echo 'dns-dirs='$DNS_NAMES >> "$GITHUB_OUTPUT" + gha_build_dns: + name: Build ${{ matrix.dns-dir }} ${{ matrix.build-for }} snap + needs: generate_dns_list_matrix + runs-on: ${{ matrix.build-on }} + strategy: + fail-fast: false + matrix: + dns-dir: ${{ fromJSON(needs.generate_dns_list_matrix.outputs.dns-dirs) }} + build-for: [arm64, amd64] + include: + - build-for: arm64 + build-on: ubuntu-24.04-arm + - build-for: amd64 + build-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6.0.2 + - name: generate dns snapcraft.yamls + run: | + tools/snap/generate_dnsplugins_all.sh # unnecessarily doing every file + - uses: snapcore/action-build@v1.3.0 + id: build + with: + snapcraft-args: "--build-for=${{ matrix.build-for }}" + path: ${{ matrix.dns-dir }} + - name: Store snap artifact + uses: actions/upload-artifact@v7.0.0 + with: + name: snap-${{ matrix.dns-dir }}-${{ matrix.build-for }} + path: ${{ steps.build.outputs.snap }} + launchpad_build: + name: Build armhf snaps + runs-on: + - ubuntu-24.04 + strategy: + matrix: + SNAP_ARCH: + - armhf + steps: + - name: checkout + uses: actions/checkout@v6.0.2 + with: + fetch-depth: 0 # need a non-shallow clone for launchpad - name: Install dependencies run: |- set -e @@ -105,11 +164,13 @@ jobs: python-version: '3.12' - name: Build snaps env: - SNAPCRAFT_STORE_CREDENTIALS: "${{ secrets.LAUNCHPAD_CREDENTIALS }}" + LAUNCHPAD_CREDS: "${{ secrets.LAUNCHPAD_CREDENTIALS }}" run: |- set -e git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" git config --global user.name "${{ github.actor }}" + mkdir -p ~/.local/share/snapcraft/ + echo "$LAUNCHPAD_CREDS" > ~/.local/share/snapcraft/launchpad-credentials python3 tools/snap/build_remote.py ALL --archs ${{ matrix.SNAP_ARCH }} --timeout ${{ env.snapBuildTimeout }} - name: Prepare artifacts run: |- @@ -122,10 +183,18 @@ jobs: name: snaps_${{ matrix.SNAP_ARCH }} path: "${{ runner.temp }}" snap_run: + name: snap_run ${{ matrix.arch-name }} needs: - - snaps_build + - gha_build runs-on: - - ubuntu-22.04 + - ${{ matrix.run-on }} + strategy: + matrix: + include: + - arch-name: arm64 + run-on: ubuntu-24.04-arm + - arch-name: amd64 + run-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v6.0.2 @@ -142,10 +211,8 @@ jobs: - name: Retrieve Certbot snaps uses: actions/download-artifact@v8.0.1 with: - name: snaps_amd64 - github_token: "${{ secrets.GITHUB_TOKEN }}" + name: snap-certbot-${{ matrix.arch-name }} path: "${{ github.workspace }}/snap" - repo: "${{ github.repository }}" - name: Install Certbot snap run: |- set -e @@ -155,10 +222,19 @@ jobs: set -e venv/bin/python -m tox run -e integration-external,apacheconftest-external-with-pebble snap_dns_run: + name: snap_dns_run ${{ matrix.arch-name }} needs: - - snaps_build + - gha_build_dns + - gha_build runs-on: - - ubuntu-22.04 + - ${{ matrix.run-on }} + strategy: + matrix: + include: + - arch-name: arm64 + run-on: ubuntu-24.04-arm + - arch-name: amd64 + run-on: ubuntu-24.04 steps: - name: checkout uses: actions/checkout@v6.0.2 @@ -173,10 +249,9 @@ jobs: - name: Retrieve Certbot snaps uses: actions/download-artifact@v8.0.1 with: - name: snaps_amd64 - github_token: "${{ secrets.GITHUB_TOKEN }}" + pattern: snap-*-${{ matrix.arch-name }} + merge-multiple: true path: "${{ github.workspace }}/snap" - repo: "${{ github.repository }}" - name: Prepare Certbot-CI run: |- set -e @@ -185,4 +260,4 @@ jobs: - name: Test DNS plugins snaps run: |- set -e - sudo -E venv/bin/pytest certbot-ci/src/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder ${{ github.workspace }}/snap --snap-arch amd64 + sudo -E venv/bin/pytest certbot-ci/src/snap_integration_tests/dns_tests --allow-persistent-changes --snap-folder ${{ github.workspace }}/snap --snap-arch ${{ matrix.arch-name }}