Add free disk space action to CI actions #5207
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Record screenshots | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [ labeled ] | |
| # Enrich gradle.properties for CI/CD | |
| env: | |
| GRADLE_OPTS: -Dorg.gradle.jvmargs=-Xmx9g -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -XX:+UseG1GC -Dkotlin.daemon.jvm.options=-Xmx4g -Dsonar.gradle.skipCompile=true | |
| CI_GRADLE_ARG_PROPERTIES: --no-configuration-cache | |
| jobs: | |
| record: | |
| name: Record screenshots on branch ${{ github.event.pull_request.head.ref || github.ref_name }} | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || github.event.label.name == 'Record-Screenshots' | |
| steps: | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be | |
| with: | |
| # This might remove tools that are actually needed, if set to "true" but frees about 6 GB | |
| tool-cache: true | |
| # All of these default to true, but we should only need the 'android' one (and maybe swap-storage?) | |
| android: false | |
| dotnet: true | |
| haskell: true | |
| # This takes way too long to run | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: false | |
| - name: Remove Record-Screenshots label | |
| if: github.event.label.name == 'Record-Screenshots' | |
| uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 | |
| with: | |
| labels: Record-Screenshots | |
| - name: ⏬ Checkout with LFS (PR) | |
| if: github.event.label.name == 'Record-Screenshots' | |
| uses: nschloe/action-cached-lfs-checkout@f46300cd8952454b9f0a21a3d133d4bd5684cfc2 # v1.2.3 | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }} | |
| - name: ⏬ Checkout with LFS (Branch) | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: nschloe/action-cached-lfs-checkout@f46300cd8952454b9f0a21a3d133d4bd5684cfc2 # v1.2.3 | |
| with: | |
| persist-credentials: false | |
| - name: ☕️ Use JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' # See 'Supported distributions' for available options | |
| java-version: '21' | |
| # Add gradle cache, this should speed up the process | |
| - name: Configure gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| with: | |
| cache-read-only: ${{ github.ref != 'refs/heads/develop' }} | |
| - name: Record screenshots | |
| id: record | |
| run: ./.github/workflows/scripts/recordScreenshots.sh | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN || secrets.GITHUB_TOKEN }} | |
| GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} | |
| GRADLE_ARGS: ${{ env.CI_GRADLE_ARG_PROPERTIES }} |