Skip to content

Commit

Permalink
Add option for freeing disk space (#964)
Browse files Browse the repository at this point in the history
Stacked on top of #942 

- Provide dedicated option instead of relying on providers to use custom
steps which are run after tool installs.
- Run as first step so we don't delete things that have just been
installed.
- Default to off to maintain existing behaviour. This can take around 3
minutes to run, so we should only run it if we're having issues.

```yaml
# Set to true to clear disk space before running prerequisites workflow.
freeDiskSpaceBeforeBuild: false
# Set to true to clear disk space before running test jobs.
freeDiskSpaceBeforeTest: false
```

This fixes oddities in Azure and AWS where we've added steps in the
`preBuild` and `preTest` to clear disk space but then have to install
tools (e.g. dotnet) a second time as they get deleted.
  • Loading branch information
danielrbradley committed Jun 12, 2024
1 parent 9272ebb commit 02e2ce7
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ fail-on-extra-mapping: true
publishRegistry: true
checkoutSubmodules: false
testMasterAndReleaseWorkflows: false
# Set to true to clear disk space before running prerequisites workflow.
freeDiskSpaceBeforeBuild: false
# Set to true to clear disk space before running test jobs.
freeDiskSpaceBeforeTest: false
toolVersions:
dotnet: "6.0.x"
go: "1.21.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ jobs:
name: prerequisites
runs-on: #{{ .Config.runner.prerequisites }}#
steps:
#{{- if .Config.freeDiskSpaceBeforeBuild }}#
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
#{{- if .Config.checkoutSubmodules }}#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ jobs:
id-token: write
runs-on: #{{ if .Config.runner.buildSdk }}##{{- .Config.runner.buildSdk }}##{{ else }}##{{- .Config.runner.default }}##{{ end }}#
steps:
#{{- if .Config.freeDiskSpaceBeforeTest }}#
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
#{{- end }}#
- name: Checkout Repo
uses: #{{ .Config.actionVersions.checkout }}#
with:
Expand Down
2 changes: 2 additions & 0 deletions provider-ci/providers/aws/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
PULUMI_MISSING_DOCS_ERROR: true
AWS_REGION: "us-west-2"
makeTemplate: bridged
freeDiskSpaceBeforeBuild: true
freeDiskSpaceBeforeTest: true
checkoutSubmodules: true
# TODO: remove XrunUpstreamTools flag after work to add docs replacement strategies to resources.go is completed
# Tracked in in https://github.com/pulumi/pulumi-aws/issues/2757
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ jobs:
name: prerequisites
runs-on: ubuntu-latest
steps:
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ jobs:
id-token: write
runs-on: pulumi-ubuntu-8core
steps:
# Run as first step so we don't delete things that have just been installed
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
with:
tool-cache: false
swap-storage: false
- name: Checkout Repo
uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 02e2ce7

Please sign in to comment.