From facf4a7bd000168c5cff6efd0d18d670a54198be Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 21 Apr 2025 18:50:51 -0500 Subject: [PATCH 1/5] feat: config actions_cache to cache cvmfs_cache_base --- action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 From 6e32f634abd5d6f4f3cd3158b6b54cb146a6ec34 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 21 Apr 2025 18:57:27 -0500 Subject: [PATCH 2/5] ci: add cache test workflow --- .github/workflows/cache.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/cache.yml diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml new file mode 100644 index 0000000..fc9de75 --- /dev/null +++ b/.github/workflows/cache.yml @@ -0,0 +1,22 @@ +name: cache +on: + push: + pull_request: + schedule: + - cron: '44 4 * * *' +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04] + steps: + - uses: actions/checkout@v4 + - uses: ./ + with: + actions_cache: true + - 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 From 474f50f0d2a353296bd45f36c229e6922e605062 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 21 Apr 2025 19:02:32 -0500 Subject: [PATCH 3/5] ci: set cvmfs_cache_base; run on ubuntu-24.04 --- .github/workflows/cache.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index fc9de75..8296ee8 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -10,12 +10,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04] + os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] steps: - uses: actions/checkout@v4 - uses: ./ with: actions_cache: true + cvmfs_cache_base: /var/lib/cvmfs - name: Test CernVM-FS run: | source /cvmfs/sft.cern.ch/lcg/views/LCG_107/x86_64-ubuntu2404-gcc13-opt/setup.sh From 4a786d4b738014c3e25c7461e7d6a91b8a3101c8 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 21 Apr 2025 19:15:08 -0500 Subject: [PATCH 4/5] ci: set cvmfs_cache_base under workspace --- .github/workflows/cache.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 8296ee8..5699da2 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -10,13 +10,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] + os: [ubuntu-24.04] steps: - uses: actions/checkout@v4 - uses: ./ with: actions_cache: true - cvmfs_cache_base: /var/lib/cvmfs + 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 From 557e438d09af172c931e9f655653b078f867b0e3 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Mon, 21 Apr 2025 19:17:23 -0500 Subject: [PATCH 5/5] ci: mkdir ${{ github.workspace }}/.cvmfs --- .github/workflows/cache.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 5699da2..39d35df 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -13,6 +13,7 @@ jobs: os: [ubuntu-24.04] steps: - uses: actions/checkout@v4 + - run: mkdir -p ${{ github.workspace }}/.cvmfs - uses: ./ with: actions_cache: true