mirror of
https://code.forgejo.org/actions/cache.git
synced 2024-11-16 23:51:16 +01:00
Add e2e test
This commit is contained in:
parent
bd94e24ffb
commit
3e8104da64
1 changed files with 46 additions and 4 deletions
50
.github/workflows/workflow.yml
vendored
50
.github/workflows/workflow.yml
vendored
|
@ -9,6 +9,7 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- releases/**
|
- releases/**
|
||||||
|
- save-always-output
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# Build and unit test
|
# Build and unit test
|
||||||
|
@ -46,10 +47,10 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Generate files in working directory
|
- name: Generate files in working directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
|
run: __tests__/create-cache-files.sh ${{ runner.os }}-save test-cache
|
||||||
- name: Generate files outside working directory
|
- name: Generate files outside working directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: __tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache
|
run: __tests__/create-cache-files.sh ${{ runner.os }}-save ~/test-cache
|
||||||
- name: Save cache
|
- name: Save cache
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
@ -76,10 +77,51 @@ jobs:
|
||||||
~/test-cache
|
~/test-cache
|
||||||
- name: Verify cache files in working directory
|
- name: Verify cache files in working directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: __tests__/verify-cache-files.sh ${{ runner.os }} test-cache
|
run: __tests__/verify-cache-files.sh ${{ runner.os }}-save test-cache
|
||||||
- name: Verify cache files outside working directory
|
- name: Verify cache files outside working directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: __tests__/verify-cache-files.sh ${{ runner.os }} ~/test-cache
|
run: __tests__/verify-cache-files.sh ${{ runner.os }}-save ~/test-cache
|
||||||
|
|
||||||
|
# End to end with save-always
|
||||||
|
test-save-always:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
fail-fast: false
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
continue-on-error: true
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Save cache
|
||||||
|
id: save-always
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
key: test-${{ runner.os }}-${{ github.run_id }}.${{ github.run_attempt }}
|
||||||
|
path: test-cache
|
||||||
|
save-always: true
|
||||||
|
- name: Generate files
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
__tests__/create-cache-files.sh ${{ runner.os }}-save-always test-cache
|
||||||
|
exit 1
|
||||||
|
test-save-always-restore:
|
||||||
|
needs: test-save-always
|
||||||
|
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:
|
||||||
|
key: test-${{ runner.os }}-${{ github.run_id }}.${{ github.run_attempt }}
|
||||||
|
path: test-cache
|
||||||
|
- name: Verify cache
|
||||||
|
run: __tests__/verify-cache-files.sh ${{ runner.os }}-save-always test-cache
|
||||||
|
|
||||||
# End to end with proxy
|
# End to end with proxy
|
||||||
test-proxy-save:
|
test-proxy-save:
|
||||||
|
|
Loading…
Reference in a new issue