From 65f7bce0f4347d4f931e2151279115a843d7ca66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 26 Nov 2024 12:45:51 +0100 Subject: [PATCH] CI: Put `build-deb` as its own job This duplicates the "build-deb" job, but make it possible to speed-up a bit more the CI runs, because we're not waiting for all the debian packages to build. --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2eb14a2..8db3e4e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: - name: Run CLI tests run: poetry run make test - build-deb: + build-all-debs: needs: - build-container-image name: "build-deb (${{ matrix.distro }} ${{ matrix.version }})" @@ -170,8 +170,6 @@ jobs: version: "24.10" - distro: debian version: bullseye - - distro: debian - version: bookworm - distro: debian version: trixie steps: @@ -221,6 +219,62 @@ jobs: if-no-files-found: error compression-level: 0 + build-deb: + needs: + - build-container-image + name: "build-deb (${{ matrix.distro }} ${{ matrix.version }})" + runs-on: ubuntu-latest + strategy: + matrix: + include: + - distro: debian + version: bookworm + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Login to GHCR + run: | + echo ${{ github.token }} | podman login ghcr.io -u USERNAME --password-stdin + + - name: Get the dev environment + run: | + ./dev_scripts/env.py \ + --distro ${{ matrix.distro }} \ + --version ${{ matrix.version }} \ + build-dev --sync + + - name: Get current date + id: date + run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT + + - name: Restore container cache + uses: actions/cache/restore@v4 + with: + key: v2-${{ steps.date.outputs.date }}-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py', 'poetry.lock', 'gvisor_wrapper/entrypoint.py') }} + path: |- + share/container.tar.gz + share/image-id.txt + fail-on-cache-miss: true + + - name: Build Dangerzone .deb + run: | + ./dev_scripts/env.py --distro ${{ matrix.distro }} \ + --version ${{ matrix.version }} \ + run --dev --no-gui ./dangerzone/install/linux/build-deb.py + + - name: Upload Dangerzone .deb + uses: actions/upload-artifact@v4 + with: + name: dangerzone-${{ matrix.distro }}-${{ matrix.version }}.deb + path: "deb_dist/dangerzone_*_*.deb" + if-no-files-found: error + compression-level: 0 + install-deb: name: "install-deb (${{ matrix.distro }} ${{ matrix.version }})" runs-on: ubuntu-latest