mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Bump every GitHub Action in the repository to its latest major version, addressing the upcoming Node.js 20 deprecation. Several of the old versions (checkout v4, cache v4, setup-node v4, labeler v5) use the Node 20 runtime which GitHub is deprecating. The new versions use Node 22. - actions/checkout v4/v5 to v6 - actions/upload-artifact v4 to v7 - actions/download-artifact v4 to v8 - actions/cache, cache/restore, cache/save v4 to v5 - actions/setup-node v4 to v6 - actions/setup-python v5 to v6 - actions/github-script v7/v8 to v9 - actions/labeler v5 to v6 - peter-evans/find-comment v3 to v4 - dorny/paths-filter v3 to v4 - codecov/codecov-action v4 to v6 - docker/setup-buildx-action v3 to v4 - docker/build-push-action v6 to v7 - tj-actions/changed-files v46 to v47 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
57 lines
1.7 KiB
YAML
57 lines
1.7 KiB
YAML
name: Setup ccache
|
|
description: Restore ccache from cache and configure ccache.conf
|
|
|
|
inputs:
|
|
cache-key-prefix:
|
|
description: Cache key prefix (e.g. ccache-sitl)
|
|
required: true
|
|
max-size:
|
|
description: Max ccache size (e.g. 300M)
|
|
required: false
|
|
default: '300M'
|
|
base-dir:
|
|
description: ccache base_dir value
|
|
required: false
|
|
default: '${GITHUB_WORKSPACE}'
|
|
install-ccache:
|
|
description: Install ccache via apt before configuring
|
|
required: false
|
|
default: 'false'
|
|
|
|
outputs:
|
|
cache-primary-key:
|
|
description: Primary cache key (pass to save-ccache)
|
|
value: ${{ steps.restore.outputs.cache-primary-key }}
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Cache - Install ccache
|
|
if: inputs.install-ccache == 'true'
|
|
shell: bash
|
|
run: apt-get update && apt-get install -y ccache
|
|
|
|
- name: Cache - Restore ccache
|
|
id: restore
|
|
uses: actions/cache/restore@v5
|
|
with:
|
|
path: ~/.ccache
|
|
key: ${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ inputs.cache-key-prefix }}-${{ github.ref_name }}-
|
|
${{ inputs.cache-key-prefix }}-${{ github.base_ref || 'main' }}-
|
|
${{ inputs.cache-key-prefix }}-
|
|
|
|
- name: Cache - Configure ccache
|
|
shell: bash
|
|
run: |
|
|
mkdir -p ~/.ccache
|
|
echo "base_dir = ${{ inputs.base-dir }}" > ~/.ccache/ccache.conf
|
|
echo "compression = true" >> ~/.ccache/ccache.conf
|
|
echo "compression_level = 6" >> ~/.ccache/ccache.conf
|
|
echo "max_size = ${{ inputs.max-size }}" >> ~/.ccache/ccache.conf
|
|
echo "hash_dir = false" >> ~/.ccache/ccache.conf
|
|
echo "compiler_check = content" >> ~/.ccache/ccache.conf
|
|
ccache -s
|
|
ccache -z
|