From 4e3c664ab3f6be778fd13772b9dafaa9cad6facf Mon Sep 17 00:00:00 2001 From: Jo Date: Sun, 18 Dec 2022 20:42:22 +0000 Subject: [PATCH] ci(yay) : attempt to use caches more effectively in CI (#1862) * attempt to use caches more effectively * fix cache key * specify cache file --- .github/workflows/testing-git.yml | 17 +++++++++++------ .github/workflows/testing.yml | 5 ++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/testing-git.yml b/.github/workflows/testing-git.yml index afbfa729..8650469c 100644 --- a/.github/workflows/testing-git.yml +++ b/.github/workflows/testing-git.yml @@ -9,25 +9,30 @@ on: jobs: build: - name: Lint and test yay + name: Lint and test yay (-git) runs-on: ubuntu-latest container: image: jguer/yay-builder:latest steps: - - name: Checkout - uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- + - uses: actions/cache@v3 + with: + path: /home/runner/work/yay/yay/pacman-git + key: ${{ runner.os }}-pacman-${{ hashFiles('/home/runner/work/yay/yay/pacman-git/PKGBUILD') }} + restore-keys: | + ${{ runner.os }}-pacman- - name: checkout pacman-git run: | - git clone https://aur.archlinux.org/pacman-git + git -C ./pacman-git pull || git clone https://aur.archlinux.org/pacman-git useradd github echo 'github ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers chmod -R 777 pacman-git - su github -c 'cd pacman-git; yes | makepkg -si --nocheck' + su github -c 'cd pacman-git; yes | makepkg -i --nocheck' - name: Run Build and Tests with pacman-git run: make test diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c5d22ccf..6e999d5e 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -14,9 +14,8 @@ jobs: container: image: jguer/yay-builder:latest steps: - - name: Checkout - uses: actions/checkout@v2 - - uses: actions/cache@v1 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}