generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (41 loc) · 1.07 KB
/
test-cache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: 'test-cache'
on:
pull_request:
push:
branches:
- main
jobs:
test-setup-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Simluate rye-project
run: cp -r ./__tests__/fixtures/rye-project/* .
- name: Setup with cache
uses: ./
with:
version: '0.11.0'
enable-cache: true
cache-key: ${{ github.run_id }}-${{ github.run_attempt }}
- run: rye sync
test-restore-cache:
runs-on: ubuntu-latest
needs: test-setup-cache
steps:
- uses: actions/checkout@v4
- name: Simluate rye-project
run: cp -r ./__tests__/fixtures/rye-project/* .
- name: Restore with cache
id: restore
uses: ./
with:
version: '0.11.0'
enable-cache: true
cache-key: ${{ github.run_id }}-${{ github.run_attempt }}
- name: Cache was hit
run: |
if [ "$CACHE_HIT" != "true" ]; then
exit 1
fi
env:
CACHE_HIT: ${{ steps.restore.outputs.cache-hit }}