--- /dev/null
+name: 'Cache ccache'
+description: 'Configure GitHub Cache for ccache'
+inputs:
+ cache-key-base:
+ description: cache key base
+ required: true
+
+runs:
+ using: "composite"
+ steps:
+ - name: get timestamp for cache
+ id: get-stamp
+ run: |
+ : get timestamp for cache
+ echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
+ shell: bash
+ working-directory: .
+ - name: make ccache directory
+ shell: bash
+ run: mkdir -p ~/.ccache
+ working-directory: .
+ - name: let GitHub cache our ccache data
+ uses: actions/cache@v4
+ with:
+ path: ~/.ccache
+ key: ${{ inputs.cache-key-base }}-${{ steps.get-stamp.outputs.stamp }}
+ restore-keys: ${{ inputs.cache-key-base }}
submodules: recursive
ref: ${{ inputs.branch-name }}
persist-credentials: false
- - name: get timestamp for cache
- id: get-stamp
- run: |
- echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
- shell: bash
- working-directory: .
- - run: mkdir -p ~/.ccache
- working-directory: .
- - name: let GitHub cache our ccache data
- uses: actions/cache@v4
+ - name: set up build
+ uses: ./.github/actions/cache
with:
- path: ~/.ccache
- key: auth-ccache-${{ matrix.builder }}-${{ steps.get-stamp.outputs.stamp }}
- restore-keys: auth-ccache-${{ matrix.builder }}
+ cache-key-base: auth-ccache-${{ matrix.builder }}
- name: set sanitizers
run: echo "SANITIZERS=${{ matrix.builder == 'meson' && 'address,undefined' || 'asan+ubsan' }}" >> "$GITHUB_ENV"
working-directory: .
submodules: recursive
ref: ${{ inputs.branch-name }}
persist-credentials: false
- - name: get timestamp for cache
- id: get-stamp
- run: |
- echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
- shell: bash
- working-directory: .
- - run: mkdir -p ~/.ccache
- working-directory: .
- - name: let GitHub cache our ccache data
- uses: actions/cache@v4
+ - name: set up build
+ uses: ./.github/actions/cache
with:
- path: ~/.ccache
- key: recursor-ccache-${{ matrix.builder }}-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ steps.get-stamp.outputs.stamp }}
- restore-keys: recursor-ccache-${{ matrix.builder }}-${{ matrix.features }}-${{ matrix.sanitizers }}
+ cache-key-base: recursor-ccache-${{ matrix.builder }}-${{ matrix.features }}-${{ matrix.sanitizers }}
- name: install pip build dependencies
run: |
python3 -m venv ${REPO_HOME}/.venv
submodules: recursive
ref: ${{ inputs.branch-name }}
persist-credentials: false
- - name: get timestamp for cache
- id: get-stamp
- run: |
- echo "stamp=$(/bin/date +%s)" >> "$GITHUB_OUTPUT"
- shell: bash
- working-directory: .
- - run: mkdir -p ~/.ccache
- working-directory: .
- - name: let GitHub cache our ccache data
- uses: actions/cache@v4
+ - name: set up build
+ uses: ./.github/actions/cache
with:
- path: ~/.ccache
- key: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ matrix.builder}}${{ matrix.architecture_suffix }}-ccache-${{ steps.get-stamp.outputs.stamp }}
- restore-keys: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ matrix.builder}}${{ matrix.architecture_suffix }}-ccache-
+ cache-key-base: dnsdist-${{ matrix.features }}-${{ matrix.sanitizers }}-${{ matrix.builder}}${{ matrix.architecture_suffix }}-ccache
- name: install pip build dependencies
run: |
python3 -m venv ${REPO_HOME}/.venv