diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml new file mode 100644 index 0000000..39d35df --- /dev/null +++ b/.github/workflows/cache.yml @@ -0,0 +1,24 @@ +name: cache +on: + push: + pull_request: + schedule: + - cron: '44 4 * * *' +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-24.04] + steps: + - uses: actions/checkout@v4 + - run: mkdir -p ${{ github.workspace }}/.cvmfs + - uses: ./ + with: + actions_cache: true + cvmfs_cache_base: ${{ github.workspace }}/.cvmfs + - name: Test CernVM-FS + run: | + source /cvmfs/sft.cern.ch/lcg/views/LCG_107/x86_64-ubuntu2404-gcc13-opt/setup.sh + root -l -q -b diff --git a/action.yml b/action.yml index 7b4551b..f6f1f86 100644 --- a/action.yml +++ b/action.yml @@ -8,6 +8,10 @@ inputs: description: 'Location (directory) of the user-space apt cache.' required: false default: 'apt_cache' + actions_cache: + description: 'Enable a GitHub Actions cache for the CernVM cache.' + required: false + default: 'false' cvmfs_alien_cache: description: 'If set, use an alien cache at the given location.' required: false @@ -351,6 +355,12 @@ runs: key: cvmfs-apt-cache-${{ steps.lsb-release.outputs.id-release }}-${{ steps.lsb-release.outputs.arch }}-${{ hashFiles('action.yml') }} path: | ${{ inputs.apt_cache }} + - uses: actions/cache@v4 + if: ${{ inputs.actions_cache == 'true' }} + with: + key: cvmfs-cache-${{ steps.lsb-release.outputs.id-release }}-${{ steps.lsb-release.outputs.arch }}-${{ hashFiles('action.yml') }} + path: | + ${{ inputs.cvmfs_cache_base }} - run: | ${{ github.action_path }}/setup-cvmfs.sh shell: bash