Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/actions/ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,26 @@ inputs:
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: "${{ inputs.name }}-${{ hashFiles('main/php_version.h') }}"
key: "${{ steps.cache_key.outputs.key }}"
append-timestamp: false
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
append-timestamp: false
append-timestamp: 0

Looking at the list of cache files, I'm seeing a trailing - which looks fishy.

Image

Looking at the action:

https://github.com/hendrikmuhs/ccache-action/blob/5ebbd400eff9e74630f759d94ddd7b6c26299639/src/restore.ts#L29

uses getInput() and

https://github.com/hendrikmuhs/ccache-action/blob/5ebbd400eff9e74630f759d94ddd7b6c26299639/src/restore.ts#L242C42-L242C57

uses getBooleanInput(), which likely causes the former to become "false" (the string, which is not falsy).

save: ${{ github.event_name != 'pull_request' }}
restore-keys: "${{ steps.cache_key.outputs.prefix }}"
#save: ${{ github.event_name != 'pull_request' }}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be reverted before merging.

- name: Export CC/CXX
shell: bash
run: |
echo "CC=ccache gcc" >> $GITHUB_ENV
echo "CXX=ccache g++" >> $GITHUB_ENV
23 changes: 20 additions & 3 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ jobs:
echo "::group::Show installed package versions"
apk list
echo "::endgroup::"
- name: ccache
uses: ./.github/actions/ccache
with:
name: "${{ github.job }}"
- name: ./configure
uses: ./.github/actions/configure-alpine
with:
Expand Down Expand Up @@ -392,6 +396,10 @@ jobs:
uses: ./.github/actions/apt-x64
- name: Install gcovr
run: sudo -H pip install gcovr
- name: ccache
uses: ./.github/actions/ccache
with:
name: "${{ github.job }}"
- name: ./configure
uses: ./.github/actions/configure-x64
with:
Expand Down Expand Up @@ -433,6 +441,10 @@ jobs:
ref: ${{ fromJson(inputs.branch).ref }}
- name: apt
uses: ./.github/actions/apt-x64
- name: ccache
uses: ./.github/actions/ccache
with:
name: "COMMUNITY_${{ matrix.type }}"
- name: ./configure
uses: ./.github/actions/configure-x64
with:
Expand Down Expand Up @@ -635,6 +647,10 @@ jobs:
uses: ./.github/actions/setup-mssql
- name: apt
uses: ./.github/actions/apt-x64
- name: ccache
uses: ./.github/actions/ccache
with:
name: "${{ matrix.job }}"
- name: ./configure
uses: ./.github/actions/configure-x64
with:
Expand Down Expand Up @@ -692,6 +708,10 @@ jobs:
ref: ${{ fromJson(inputs.branch).ref }}
- name: apt
uses: ./.github/actions/apt-x64
- name: ccache
uses: ./.github/actions/ccache
with:
name: "${{ matrix.job }}"
- name: ./configure
run: |
export CC=clang
Expand Down Expand Up @@ -806,9 +826,6 @@ jobs:
PECL:
if: ${{ fromJson(inputs.branch).jobs.PECL }}
runs-on: ubuntu-24.04
env:
CC: ccache gcc
CXX: ccache g++
steps:
- name: git checkout PHP
uses: actions/checkout@v6
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ permissions:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.url || github.run_id }}
cancel-in-progress: true
env:
CC: ccache gcc
CXX: ccache g++
jobs:
GENERATE_MATRIX:
name: Generate Matrix
Expand Down
Loading