diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 070f296c6..ba5071dcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,8 @@ jobs: - uses: actions/checkout@v4 - name: Install Podman in Ubuntu Focal run: "./install/linux/install-podman-ubuntu-focal.sh" - - name: restore_cache + + - name: Restore container cache uses: actions/cache@v4 with: key: v2-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py') }} @@ -132,7 +133,21 @@ jobs: with: python-version: "3.10" + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Restore dev environment cache + id: cache-dev-env + uses: actions/cache@v4 + with: + key: dev-environment-{{ matrix.target }}-${{ steps.date.outputs.date }} + path: |- + ~/.local/cache/containers + ~/.local/cache/dangerzone-dev + - name: Build dev environment + if: steps.cache-dev-env.outputs.cache-hit != 'true' run: | ./dev_scripts/env.py --distro ${{ matrix.distro }} \ --version ${{ matrix.version }} \ @@ -141,7 +156,7 @@ jobs: - name: Install container build dependencies run: sudo apt install pipx && pipx install poetry - - name: restore_cache + - name: Restore container cache uses: actions/cache@v4 with: key: v2-${{ hashFiles('Dockerfile', 'dangerzone/conversion/common.py', 'dangerzone/conversion/doc_to_pixels.py', 'dangerzone/conversion/pixels_to_pdf.py') }} @@ -205,7 +220,21 @@ jobs: name: dangerzone.deb path: "deb_dist/" - - name: Create end-user environment on (${{ matrix.target }}) + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Restore end user environment cache + id: cache-enduser-env + uses: actions/cache@v4 + with: + key: enduser-environment-{{ matrix.target }}-${{ steps.date.outputs.date }} + path: |- + ~/.local/cache/containers + ~/.local/cache/dangerzone-dev + + - name: Build enduser environment + if: steps.cache-enduser-env.outputs.cache-hit != 'true' run: | ./dev_scripts/env.py --distro ${{ matrix.distro }} \ --version ${{ matrix.version }} \ @@ -259,7 +288,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get current date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - name: Restore dev environment cache + id: cache-dev-env + uses: actions/cache@v4 + with: + key: dev-environment-{{ matrix.target }}-${{ steps.date.outputs.date }} + path: |- + ~/.local/cache/containers + ~/.local/cache/dangerzone-dev + - name: Build dev environment + if: steps.cache-dev-env.outputs.cache-hit != 'true' run: | ./dev_scripts/env.py --distro fedora --version ${{ matrix.version }} \ build-dev