From ff7d5378041aab93718144182f9420e944308949 Mon Sep 17 00:00:00 2001 From: JesusPoderoso Date: Mon, 17 Jun 2024 11:23:47 +0200 Subject: [PATCH] Refs #20822: Use CCache based on an input parameter Signed-off-by: JesusPoderoso --- .github/workflows/nightly-ubuntu-ci.yml | 5 +++++ .github/workflows/reusable-ubuntu-ci.yml | 13 +++++++++++++ .github/workflows/ubuntu-ci.yml | 6 ++++++ 3 files changed, 24 insertions(+) diff --git a/.github/workflows/nightly-ubuntu-ci.yml b/.github/workflows/nightly-ubuntu-ci.yml index cf6ca0a039b..5ef36ccac7c 100644 --- a/.github/workflows/nightly-ubuntu-ci.yml +++ b/.github/workflows/nightly-ubuntu-ci.yml @@ -23,6 +23,7 @@ jobs: fastdds-branch: 'master' security: ${{ matrix.security }} run-tests: true + use-ccache: true nightly-ubuntu-ci-2_14_x: strategy: @@ -41,6 +42,7 @@ jobs: fastdds-branch: '2.14.x' security: ${{ matrix.security }} run-tests: true + use-ccache: true nightly-ubuntu-ci-2_13_x: strategy: @@ -59,6 +61,7 @@ jobs: fastdds-branch: '2.13.x' security: ${{ matrix.security }} run-tests: true + use-ccache: true nightly-ubuntu-ci-2_10_x: strategy: @@ -77,6 +80,7 @@ jobs: fastdds-branch: '2.10.x' security: ${{ matrix.security }} run-tests: true + use-ccache: true nightly-ubuntu-ci-2_6_x: strategy: @@ -95,3 +99,4 @@ jobs: fastdds-branch: '2.6.x' security: ${{ matrix.security }} run-tests: true + use-ccache: true diff --git a/.github/workflows/reusable-ubuntu-ci.yml b/.github/workflows/reusable-ubuntu-ci.yml index 4171986876a..bb5bb5a9de6 100644 --- a/.github/workflows/reusable-ubuntu-ci.yml +++ b/.github/workflows/reusable-ubuntu-ci.yml @@ -37,6 +37,11 @@ on: required: false type: boolean default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false env: security-cmake-flag: ${{ inputs.security == true && '-DSECURITY=ON' || '-DSECURITY=OFF' }} @@ -96,6 +101,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -167,6 +173,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -266,6 +273,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -348,6 +356,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -426,6 +435,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -531,6 +541,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -611,6 +622,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} @@ -712,6 +724,7 @@ jobs: - name: Setup CCache uses: eProsima/eProsima-CI/external/setup-ccache-action@v0 + if: ${{ inputs.use-ccache == true }} with: api_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 5814f326f5e..0548a9b9664 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -33,6 +33,11 @@ on: required: false type: boolean default: true + use-ccache: + description: 'Use CCache to speed up the build' + required: false + type: boolean + default: false pull_request: types: @@ -65,3 +70,4 @@ jobs: fastdds-branch: ${{ inputs.fastdds_branch || github.ref || 'master' }} security: ${{ ((inputs.security == true) && true) || github.event_name == 'pull_request' }} run-tests: ${{ ((inputs.run-tests == true) && true) || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'no-test')) }} + use-ccache: ${{ ((inputs.use-ccache == true) && true) || false }}