Skip to content

Commit

Permalink
Add basic test running in specific runner
Browse files Browse the repository at this point in the history
[f:1h]
  • Loading branch information
stefanmaric committed Aug 1, 2023
1 parent 5439334 commit cc33dd5
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Push
on: push

env:
SHARED_CACHE_RUN_KEY: CACHE_V1-${{ github.run_id }}-${{ github.run_attempt }}

jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install
- run: npm run all

first-run:
runs-on:
group: local-action-cache
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:
group: local-action-cache
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
- name: Check contents
run: cat ./demo-output.txt
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Add basic test running in specific runner
- Replace ncc with tsup and fix misc lint issues
- Upgrade nodejs version and all dependencies

Expand Down

0 comments on commit cc33dd5

Please sign in to comment.