Skip to content

Commit

Permalink
CACHE ALL THE THINGS
Browse files Browse the repository at this point in the history
  • Loading branch information
almet committed Sep 12, 2024
1 parent cdbcb50 commit 70840f5
Showing 1 changed file with 46 additions and 3 deletions.
49 changes: 46 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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') }}
Expand Down Expand Up @@ -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 }} \
Expand All @@ -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') }}
Expand Down Expand Up @@ -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 }} \
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 70840f5

Please sign in to comment.