Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
32 changes: 32 additions & 0 deletions .github/actions/orchestrator-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Setup Orchestrator Cache
description: Sets up orchestrator cache

inputs:
sq-version:
description: 'SonarQube version. If DEV, cache will be disabled.'
required: true

runs:
using: composite
steps:
- name: Set Orchestrator Cache Variables
shell: bash
run: |
# year-week
CACHE_KEY=$(date +'%Y-%U')
echo "ORCHESTRATOR_CACHE_KEY=$CACHE_KEY" >> $GITHUB_ENV
echo "ORCHESTRATOR_HOME=${{ github.workspace }}/orchestrator" >> $GITHUB_ENV

- name: Cache Orchestrator
if: inputs.sq-version != 'DEV'
uses: SonarSource/gh-action_cache@v1
with:
path: ${{ env.ORCHESTRATOR_HOME }}
key: orchestrator-${{ inputs.sq-version }}-${{ env.ORCHESTRATOR_CACHE_KEY }}-${{ github.run_id }}
restore-keys: orchestrator-${{ inputs.sq-version }}-${{ env.ORCHESTRATOR_CACHE_KEY }}-

- name: Setup Orchestrator Home Directory
shell: bash
run: |
mkdir -p "$ORCHESTRATOR_HOME"
ls -lRh "$ORCHESTRATOR_HOME"
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ jobs:
artifactory-reader-role: private-reader
use-develocity: ${{ env.USE_DEVELOCITY }}
develocity-url: ${{ env.DEVELOCITY_URL }}
- name: Orchestrator Cache
uses: ./.github/actions/orchestrator-cache
with:
sq-version: ${{ matrix.item.sq_version }}
- name: Run QA Tests
env:
GITHUB_TOKEN: ${{ fromJSON(steps.secrets.outputs.vault).GITHUB_TOKEN }}
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Cleanup S3 Cache

on:
workflow_dispatch:
inputs:
branch:
description: "Branch name (e.g., 'feature/my-branch'). Leave empty to list all entries."
required: false
type: string
default: ""
key:
description: "Cache key prefix (e.g., 'sccache-Linux-')"
required: false
type: string
default: ""
dry-run:
description: "Preview deletions without executing them"
required: false
type: boolean
default: true

jobs:
cleanup:
runs-on: github-ubuntu-latest-s
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.

Perhaps we don't need github-ubuntu-latest-s (4 CPU, 16GB) and could use sonar-xs-public (1 CPU, 4GB) here. WDYT?

permissions:
id-token: write
contents: read
steps:
- uses: SonarSource/gh-action_cache/cleanup@v1
with:
branch: ${{ inputs.branch }}
key: ${{ inputs.key }}
dry-run: ${{ inputs.dry-run }}
Loading