Skip to content

Commit

Permalink
Update caching in Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Dec 27, 2023
1 parent 19e4ec7 commit 6fd1a59
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/nextflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,25 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Build
run: make build

- name: Cache Funnel Binary
- name: Cache Funnel binary
uses: actions/cache@v2
with:
path: funnel
key: funnel-${{ github.sha }}
key: ${{ runner.os }}-funnel-${{ hashFiles('main.go') }}
restore-keys: |
${{ runner.os }}-funnel-
- name: Build Funnel (if cache does not exist)
if: steps.cache-funnel.outputs.cache-hit != 'true'
run: make build

- name: Store funnel (if built)
if: steps.cache-funnel.outputs.cache-hit != 'true'
uses: actions/upload-artifact@v2
with:
name: funnelBin
path: funnel

- name: Store funnel
uses: actions/upload-artifact@v2
with:
Expand All @@ -34,19 +44,18 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Restore Cached Funnel Binary
id: cache-funnel
uses: actions/cache@v2
- name: Download funnel (if not cached)
uses: actions/download-artifact@v2
if: needs.build.outputs.cache-hit != 'true'
with:
name: funnelBin
path: funnel
key: funnel-${{ github.sha }}

- name: Download funnel
if: steps.cache-funnel.outputs.cache-hit != 'true'
uses: actions/download-artifact@v2
- name: Restore Funnel from cache (if exists)
uses: actions/cache@v2
with:
name: funnelBin
path: funnel
key: ${{ runner.os }}-funnel-${{ hashFiles('funnel.go') }}

- name: Start Funnel
working-directory:
Expand Down

0 comments on commit 6fd1a59

Please sign in to comment.