Skip to content

Add basic test running in specific runner #1

Add basic test running in specific runner

Add basic test running in specific runner #1

Workflow file for this run

name: Push
on: push
env:
SHARED_CACHE_RUN_KEY: CACHE_V1-${{ github.run_id }}-${{ github.run_attempt }}
jobs:
tests:
runs-on: action-local-cache-tester
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run all
first-run:
runs-on: action-local-cache-tester
steps:
- uses: actions/checkout@v3
- name: 'Run first time without cache'
id: 'first-run'
uses: ./
with:
path: './demo-output.txt'
key: ${{ env.SHARED_CACHE_RUN_KEY }}
- name: Assert output
if: steps.first-run.outputs.cache-hit == 'true'
run: echo "Should not have done cache hit" && exit 1
- name: Write cache file
run: echo "demo-results" > ./demo-output.txt
second-run:
runs-on: action-local-cache-tester
needs: [first-run]
steps:
- uses: actions/checkout@v3
- uses: ./
id: 'second-run'
with:
path: './demo-output.txt'
key: ${{ env.SHARED_CACHE_RUN_KEY }}
- name: Assert output
if: steps.second-run.outputs.cache-hit != 'true'
run: echo "Should have hit cache" && exit 1