Skip to content

feat: add action

feat: add action #1

Workflow file for this run

name: main
on:
push:
jobs:
put-to-cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p a/b/c
echo "1234" >> a/b/c/file.txt
echo "000" >> file.txt
- uses: ../../
with:
path: |
a/b/c/file.txt
file.txt
key: cache-${{ github.run_id }}-${{ github.sha }}
read-cache:
needs: [put-to-cache]
runs-on: ubuntu-latest
steps:
- uses: ../../
with:
path: |
a/b/c/file.txt
file.txt
key: cache-${{ github.run_id }}-${{ github.sha }}
- run: |
test -f a/b/c/file.txt
test -f file.txt
read-partial-cache:
needs: [put-to-cache]
runs-on: ubuntu-latest
steps:
- uses: ../../
with:
path: |
a/b/c/file.txt
key: cache-${{ github.run_id }}-${{ github.sha }}
- run: |
test -f a/b/c/file.txt
read-cache-and-overwrite:
needs: [put-to-cache]
runs-on: ubuntu-latest
steps:
- run: |
echo "-" >> a/b/c/file.txt
- uses: ../../
with:
path: |
a/b/c/file.txt
file.txt
key: cache-${{ github.run_id }}-${{ github.sha }}
- run: |
test -f a/b/c/file.txt
test -f file.txt
lookup-cache:
needs: [put-to-cache]
runs-on: ubuntu-latest
steps:
- run: |
echo "-" >> a/b/c/file.txt
- uses: ../../restore
id: restore
with:
lookup-only: true
key: cache-${{ github.run_id }}-${{ github.sha }}
- run: echo ${{ steps.restore.outputs.cache-hit }}