Currently I have a job on linux with a fairly complex matrix.
jobs:
linux:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ...]
compiler: [{cc: gcc, cxx: g++}, {cc:clang, cxx:clang++}]
config: [debug, release]
cpp_std: [17, 20]
... # Address sanitizer, thread sanitizer, etc.
And I'm using ccache
. So I need to make a unique key for the job. However, the more I complicate the matrix the more complicated the key gets.
Here is what I mean
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-${{ matrix.config }}-${{ matrix.compiler.cc }}-${{ matrix.compiler.cxx }}-${{ matrix.cpp_std }}-${{ matrix.flags.c }}-${{ matrix.flags.ld }}
The key is over 158 characters and is very easy to forget to update correctly.
Is there a better way to write this?