From f7e678476f4a01034868ecf225b907235b9e9d8e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 21 Jan 2023 09:13:36 +0100 Subject: [PATCH] .github/workflows/push.yml: enable ccache This reduces the LINUX_X64_RELEASE_ZTS build time from 9-10 minutes to less than 3 minutes. Closes GH-10395 --- .github/workflows/push.yml | 18 ++++++++++++++++++ .gitignore | 1 + 2 files changed, 19 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0e29c87e550..9fc0d05747c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -17,6 +17,9 @@ on: pull_request: branches: - '**' +env: + CC: ccache gcc + CXX: ccache g++ jobs: LINUX_X64: strategy: @@ -38,6 +41,13 @@ jobs: uses: ./.github/actions/setup-oracle - name: apt uses: ./.github/actions/apt-x64 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + # This duplicates the "job.name" expression above because + # GitHub has no way to query the job name (github.job is the + # job id, not the job name) + key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}" - name: ./configure uses: ./.github/actions/configure-x64 with: @@ -83,6 +93,10 @@ jobs: uses: actions/checkout@v3 - name: apt uses: ./.github/actions/apt-x32 + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - name: ./configure uses: ./.github/actions/configure-x32 with: @@ -109,6 +123,10 @@ jobs: uses: actions/checkout@v3 - name: brew uses: ./.github/actions/brew + - name: ccache + uses: hendrikmuhs/ccache-action@v1.2 + with: + key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" - name: ./configure uses: ./.github/actions/configure-macos with: diff --git a/.gitignore b/.gitignore index 1d55b6d9e20..d455b348548 100644 --- a/.gitignore +++ b/.gitignore @@ -281,6 +281,7 @@ tmp-php.ini # GitHub actions cache # ------------------------------------------------------------------------------ /branch-commit-cache.json +/.ccache/ # ------------------------------------------------------------------------------ # Special cases to invert previous ignore patterns