Merge pull request #4018 from mmuetzel/ci

Adapt CI rules for MSYS2 for updated ccache
This commit is contained in:
Martin Kroeker 2023-04-21 23:52:13 +02:00 committed by GitHub
commit d1b631899b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 9 deletions

View File

@ -217,14 +217,21 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Compilation cache - name: Prepare ccache
uses: actions/cache@v3 # Get cache location of ccache
with: # Create key that is used in action/cache/restore and action/cache/save steps
# It looks like this path needs to be hard-coded. id: ccache-prepare
path: C:/msys64/home/runneradmin/.ccache run: |
echo "ccachedir=$(cygpath -m $(ccache -k cache_dir))" >> $GITHUB_OUTPUT
# We include the commit sha in the cache key, as new cache entries are # We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet. # only created if there is no existing entry for the key yet.
key: ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }}-${{ github.sha }} echo "key=ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Restore ccache
uses: actions/cache/restore@v3
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
# Restore a matching ccache cache entry. Prefer same branch. # Restore a matching ccache cache entry. Prefer same branch.
restore-keys: | restore-keys: |
ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }} ccache-msys2-${{ matrix.msystem }}-${{ matrix.idx }}-${{ matrix.build-type }}-${{ github.ref }}
@ -234,9 +241,10 @@ jobs:
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota. # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
run: | run: |
which ccache which ccache
test -d ~/.ccache || mkdir -p ~/.ccache test -d ${{ steps.ccache-prepare.outputs.ccachedir }} || mkdir -p ${{ steps.ccache-prepare.outputs.ccachedir }}
echo "max_size = 250M" > ~/.ccache/ccache.conf echo "max_size = 250M" > ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
echo "compression = true" >> ~/.ccache/ccache.conf echo "compression = true" >> ${{ steps.ccache-prepare.outputs.ccachedir }}/ccache.conf
ccache -p
ccache -s ccache -s
echo $HOME echo $HOME
cygpath -w $HOME cygpath -w $HOME
@ -264,6 +272,13 @@ jobs:
continue-on-error: true continue-on-error: true
run: ccache -s run: ccache -s
- name: Save ccache
# Save the cache after we are done (successfully) building
uses: actions/cache/save@v3
with:
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
key: ${{ steps.ccache-prepare.outputs.key }}
- name: Run tests - name: Run tests
timeout-minutes: 60 timeout-minutes: 60
run: cd build && ctest run: cd build && ctest