Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/create_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,29 @@ name: "Create GHA cache"
# branch (which is where almost all PRs merge into).

on:
workflow_call: # when called from a downstream repo
inputs:
# GHA doesn't seem to provide a simple way to detect workflow_call events
# so we are using an extra input (which is only available when this workflow
# is called from another workflow) with a default value (such that we don't
# have to set it every time)
external-call:
type: boolean
default: true
required: false
push:
branches: [develop]

# Cancel running jobs if there's a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
# GitHub Actions cache of the pre-commit environment
pre-commit:
# Downstream repos have their own pre-commit environment
if: ${{!inputs.external-call}}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down Expand Up @@ -73,3 +85,8 @@ jobs:
wget ${{ env.TEST_DATA_URL }}
tar -xzvf 8.1.3_c12_6ranks_standard.tar.gz
rm 8.1.3_c12_6ranks_standard.tar.gz

pySHiELD-test-data:
# Downstream calls may not need this. If so, they should fetch it explicitly.
if: ${{!inputs.external-call}}
uses: NOAA-GFDL/pySHiELD/.github/workflows/create_cache.yml@develop