Skip to content

Commit 1cfc04e

Browse files
committed
fix: Added Step to cleanup disk space
1 parent 4708f15 commit 1cfc04e

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

.github/workflows/cicd-dotnet.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ on:
3333
required: false
3434
type: boolean
3535
default: false
36+
enableCleanUp:
37+
required: false
38+
type: boolean
39+
default: false
3640
runs-on-build:
3741
required: false
3842
type: string
@@ -105,6 +109,7 @@ jobs:
105109
uses: ./.github/workflows/step-dotnet-tests.yml
106110
with:
107111
enableSonarQube: ${{ inputs.enableSonarQube || false }}
112+
enableCleanUp: ${{ inputs.enableCleanUp || false }}
108113
disableCoverageUpload: ${{ inputs.disableCoverageUpload || false }}
109114
dotnet-logging: ${{ inputs.dotnet-logging || 'quiet' }}
110115
dotnet-version: ${{ inputs.dotnet-version || '8.x' }}

.github/workflows/step-dotnet-tests.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
required: false
66
type: boolean
77
default: false
8+
enableCleanUp:
9+
required: false
10+
type: boolean
11+
default: false
812
disableCoverageUpload:
913
required: false
1014
type: boolean
@@ -64,6 +68,24 @@ jobs:
6468
dotnet-version: ${{ inputs.dotnet-version }}
6569
dotnet-quality: ${{ inputs.dotnet-quality }}
6670

71+
# Our modules occupy too much disk space. The GitHub-hosted runners ran into the
72+
# error: "no space left on device." The pulled images are not cleaned up between
73+
# the test runs. One obvious approach is splitting the tests and running them on
74+
# multiple runners. However, we need to keep in mind that running too many
75+
# simultaneous builds has an impact on others as well. We observed that scheduled
76+
# Dependabot builds blocked others in the Testcontainers organization.
77+
- name: Free Disk Space
78+
uses: jlumbroso/free-disk-space@v1.3.1
79+
if: ${{ inputs.enableCleanUp == true && runner.os == 'Linux' }}
80+
with:
81+
tool-cache: true
82+
android: true
83+
dotnet: true
84+
haskell: true
85+
large-packages: true
86+
docker-images: true
87+
swap-storage: false
88+
6789
- name: Setup JDK 17
6890
if: ${{ inputs.enableSonarQube == true }}
6991
uses: actions/setup-java@v4
@@ -96,7 +118,6 @@ jobs:
96118
run: |
97119
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
98120
99-
100121
- name: Stop SonarQube Analysis
101122
if: ${{ inputs.enableSonarQube == true && (success() || steps.test.conclusion == 'failure') }}
102123
id: sonar

0 commit comments

Comments
 (0)