-
Notifications
You must be signed in to change notification settings - Fork 8k
Expand file tree
/
Copy pathaction.yml
More file actions
30 lines (30 loc) · 1.03 KB
/
action.yml
File metadata and controls
30 lines (30 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: ccache
inputs:
name:
required: true
runs:
using: composite
steps:
- name: Get cache key
shell: bash
id: cache_key
run: |
major=$(cat main/php_version.h | sed -En 's/^#define PHP_MAJOR_VERSION ([0-9]+)/\1/p')
minor=$(cat main/php_version.h | sed -En 's/^#define PHP_MINOR_VERSION ([0-9]+)/\1/p')
release=$(cat main/php_version.h | sed -En 's/^#define PHP_RELEASE_VERSION ([0-9]+)/\1/p')
week=$(date +"%Y-%W")
prefix="${{ inputs.name }}-$major.$minor.$release"
echo "key=$prefix-$week" >> $GITHUB_OUTPUT
echo "prefix=$prefix-" >> $GITHUB_OUTPUT
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: "${{ steps.cache_key.outputs.key }}"
append-timestamp: false
restore-keys: "${{ steps.cache_key.outputs.prefix }}"
save: ${{ github.event_name != 'pull_request' }}
- name: Export CC/CXX
shell: bash
run: |
echo "CC=ccache gcc" >> $GITHUB_ENV
echo "CXX=ccache g++" >> $GITHUB_ENV