diff --git a/.github/workflows/cicd-dotnet.yml b/.github/workflows/cicd-dotnet.yml index 10e94cd..516b2c6 100644 --- a/.github/workflows/cicd-dotnet.yml +++ b/.github/workflows/cicd-dotnet.yml @@ -33,6 +33,10 @@ on: required: false type: boolean default: false + enableCleanUp: + required: false + type: boolean + default: false runs-on-build: required: false type: string @@ -105,6 +109,7 @@ jobs: uses: ./.github/workflows/step-dotnet-tests.yml with: enableSonarQube: ${{ inputs.enableSonarQube || false }} + enableCleanUp: ${{ inputs.enableCleanUp || false }} disableCoverageUpload: ${{ inputs.disableCoverageUpload || false }} dotnet-logging: ${{ inputs.dotnet-logging || 'quiet' }} dotnet-version: ${{ inputs.dotnet-version || '8.x' }} diff --git a/.github/workflows/step-dotnet-tests.yml b/.github/workflows/step-dotnet-tests.yml index 0da643e..259e386 100644 --- a/.github/workflows/step-dotnet-tests.yml +++ b/.github/workflows/step-dotnet-tests.yml @@ -5,6 +5,10 @@ on: required: false type: boolean default: false + enableCleanUp: + required: false + type: boolean + default: false disableCoverageUpload: required: false type: boolean @@ -64,6 +68,24 @@ jobs: dotnet-version: ${{ inputs.dotnet-version }} dotnet-quality: ${{ inputs.dotnet-quality }} + # Our modules occupy too much disk space. The GitHub-hosted runners ran into the + # error: "no space left on device." The pulled images are not cleaned up between + # the test runs. One obvious approach is splitting the tests and running them on + # multiple runners. However, we need to keep in mind that running too many + # simultaneous builds has an impact on others as well. We observed that scheduled + # Dependabot builds blocked others in the Testcontainers organization. + - name: Free Disk Space + uses: jlumbroso/free-disk-space@v1.3.1 + if: ${{ inputs.enableCleanUp == true && runner.os == 'Linux' }} + with: + tool-cache: true + android: true + dotnet: true + haskell: true + large-packages: true + docker-images: true + swap-storage: false + - name: Setup JDK 17 if: ${{ inputs.enableSonarQube == true }} uses: actions/setup-java@v4 @@ -96,7 +118,6 @@ jobs: run: | dotnet test ${{ inputs.solution }} -c Release -v ${{ inputs.dotnet-logging }} --no-build --no-restore --collect:"XPlat Code Coverage" /p:GeneratePackageOnBuild=false -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover - - name: Stop SonarQube Analysis if: ${{ inputs.enableSonarQube == true && (success() || steps.test.conclusion == 'failure') }} id: sonar