1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-05-04 09:19:55 +02:00

build action & add jobs to Tests workflow for only-restore option

* add regular & proxy server jobs
* run job between save & restore jobs to test that only-restore option
  works with consecutive restores
This commit is contained in:
Vincent Clemson 2022-06-18 17:20:32 -04:00
parent 4827442d41
commit 02fa69bea4
3 changed files with 93 additions and 42 deletions

View file

@ -71,6 +71,30 @@ jobs:
path: |
test-cache
~/test-cache
test-only-restore:
needs: test-restore
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore cache
uses: ./
with:
only-restore: true
key: test-${{ runner.os }}-${{ github.run_id }}
path: |
test-cache
~/test-cache
- name: Verify cache files in working directory
shell: bash
run: __tests__/verify-cache-files.sh ${{ runner.os }} test-cache
- name: Verify cache files outside working directory
shell: bash
run: __tests__/verify-cache-files.sh ${{ runner.os }} ~/test-cache
test-restore:
needs: test-save
strategy:
@ -118,6 +142,30 @@ jobs:
with:
key: test-proxy-${{ github.run_id }}
path: test-cache
test-proxy-only-restore:
needs: test-proxy-save
runs-on: ubuntu-latest
container:
image: ubuntu:latest
options: --dns 127.0.0.1
services:
squid-proxy:
image: datadog/squid:latest
ports:
- 3128:3128
env:
https_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Restore cache
uses: ./
with:
only-restore: true
key: test-proxy-${{ github.run_id }}
path: test-cache
- name: Verify cache
run: __tests__/verify-cache-files.sh proxy test-cache
test-proxy-restore:
needs: test-proxy-save
runs-on: ubuntu-latest