mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[ci] Free disk space in Gradle and Bazel builds (#8405)
This commit is contained in:
58
.github/workflows/bazel.yml
vendored
58
.github/workflows/bazel.yml
vendored
@@ -12,14 +12,14 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- { name: "Linux System Core", classifier: "linuxsystemcore", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "build" }
|
- { name: "Linux System Core", classifier: "linuxsystemcore", os: ubuntu-24.04, action: "build" }
|
||||||
- { name: "Linux System Core Debug", classifier: "linuxsystemcoredebug", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "build" }
|
- { name: "Linux System Core Debug", classifier: "linuxsystemcoredebug", os: ubuntu-24.04, action: "build" }
|
||||||
- { name: "Linux System Core Static", classifier: "linuxsystemcorestatic", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "build" }
|
- { name: "Linux System Core Static", classifier: "linuxsystemcorestatic", os: ubuntu-24.04, action: "build" }
|
||||||
- { name: "Linux System Core Static Debug", classifier: "linuxsystemcorestaticdebug", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "build" }
|
- { name: "Linux System Core Static Debug", classifier: "linuxsystemcorestaticdebug", os: ubuntu-24.04, action: "build" }
|
||||||
- { name: "Linux x86-64", classifier: "linuxx86-64,headers,sources", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "test" }
|
- { name: "Linux x86-64", classifier: "linuxx86-64,headers,sources", os: ubuntu-24.04, action: "test" }
|
||||||
- { name: "Linux x86-64 Debug", classifier: "linuxx86-64debug", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "test" }
|
- { name: "Linux x86-64 Debug", classifier: "linuxx86-64debug", os: ubuntu-24.04, action: "test" }
|
||||||
- { name: "Linux x86-64 Static", classifier: "linuxx86-64static", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "test" }
|
- { name: "Linux x86-64 Static", classifier: "linuxx86-64static", os: ubuntu-24.04, action: "test" }
|
||||||
- { name: "Linux x86-64 Static Debug", classifier: "linuxx86-64staticdebug", os: ubuntu-24.04, container: "wpilib/systemcore-cross-ubuntu:2027-24.04", action: "test" }
|
- { name: "Linux x86-64 Static Debug", classifier: "linuxx86-64staticdebug", os: ubuntu-24.04, action: "test" }
|
||||||
|
|
||||||
- { name: "macOS", classifier: "osxuniversal,osxuniversaldebug,headers,sources,osxuniversalstatic,osxuniversalstaticdebug,linuxsystemcore,linuxsystemcoredebug,linuxsystemcorestatic,linuxsystemcorestaticdebug", os: macOS-15, action: "test" }
|
- { name: "macOS", classifier: "osxuniversal,osxuniversaldebug,headers,sources,osxuniversalstatic,osxuniversalstaticdebug,linuxsystemcore,linuxsystemcoredebug,linuxsystemcorestatic,linuxsystemcorestaticdebug", os: macOS-15, action: "test" }
|
||||||
|
|
||||||
@@ -34,8 +34,34 @@ jobs:
|
|||||||
|
|
||||||
name: "${{ matrix.action == 'test' && 'Test' || 'Build' }} ${{ matrix.name }}"
|
name: "${{ matrix.action == 'test' && 'Test' || 'Build' }} ${{ matrix.name }}"
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
container: ${{ matrix.container }}
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check disk free space pre-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
|
- name: Free disk space (Linux)
|
||||||
|
uses: jlumbroso/free-disk-space@main
|
||||||
|
with:
|
||||||
|
tool-cache: false
|
||||||
|
android: true
|
||||||
|
dotnet: true
|
||||||
|
haskell: true
|
||||||
|
large-packages: false
|
||||||
|
docker-images: false
|
||||||
|
swap-storage: false
|
||||||
|
if: startsWith(matrix.os, 'ubuntu')
|
||||||
|
- name: Free disk space (macOS)
|
||||||
|
# CodeQL: 5G
|
||||||
|
# go: 748M
|
||||||
|
# Android: 12G
|
||||||
|
run: |
|
||||||
|
rm -rf /Users/runner/hostedtoolcache/CodeQL
|
||||||
|
rm -rf /Users/runner/hostedtoolcache/go
|
||||||
|
rm -rf /Users/runner/Library/Android
|
||||||
|
if: startsWith(matrix.os, 'macOS')
|
||||||
|
|
||||||
|
- name: Check disk free space post-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with: { fetch-depth: 0 }
|
with: { fetch-depth: 0 }
|
||||||
|
|
||||||
@@ -45,6 +71,10 @@ jobs:
|
|||||||
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
|
username: ${{ secrets.BAZEL_CACHE_USERNAME }}
|
||||||
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
|
password: ${{ secrets.BAZEL_CACHE_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Install apt dependencies
|
||||||
|
if: matrix.os == 'ubuntu-24.04'
|
||||||
|
run: sudo apt-get install -y libgl1-mesa-dev libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev
|
||||||
|
|
||||||
- if: matrix.os == 'ubuntu-24.04'
|
- if: matrix.os == 'ubuntu-24.04'
|
||||||
uses: bazel-contrib/setup-bazel@0.15.0
|
uses: bazel-contrib/setup-bazel@0.15.0
|
||||||
with:
|
with:
|
||||||
@@ -67,15 +97,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Free Space
|
- name: Check disk free space
|
||||||
if: always()
|
if: always()
|
||||||
shell: bash
|
run: df -h
|
||||||
run: |
|
|
||||||
if [[ "${{ matrix.os }}" == "windows-2022" ]]; then
|
|
||||||
fsutil volume diskfree C:
|
|
||||||
else
|
|
||||||
df -h /
|
|
||||||
fi
|
|
||||||
|
|
||||||
buildifier:
|
buildifier:
|
||||||
name: "buildifier"
|
name: "buildifier"
|
||||||
|
|||||||
65
.github/workflows/gradle.yml
vendored
65
.github/workflows/gradle.yml
vendored
@@ -35,7 +35,10 @@ jobs:
|
|||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs: [validation]
|
needs: [validation]
|
||||||
steps:
|
steps:
|
||||||
- name: Free Disk Space
|
- name: Check disk free space pre-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
|
- name: Free disk space
|
||||||
uses: jlumbroso/free-disk-space@main
|
uses: jlumbroso/free-disk-space@main
|
||||||
with:
|
with:
|
||||||
tool-cache: false
|
tool-cache: false
|
||||||
@@ -45,6 +48,10 @@ jobs:
|
|||||||
large-packages: false
|
large-packages: false
|
||||||
docker-images: false
|
docker-images: false
|
||||||
swap-storage: false
|
swap-storage: false
|
||||||
|
|
||||||
|
- name: Check disk free space post-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -52,21 +59,24 @@ jobs:
|
|||||||
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
||||||
if: startsWith(github.ref, 'refs/tags/v2027')
|
if: startsWith(github.ref, 'refs/tags/v2027')
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
|
# main on 2021-05-30, to include addnab/docker-run-action/pull/17
|
||||||
uses: addnab/docker-run-action@3e77f186b7a929ef010f183a9e24c0f9955ea609
|
uses: addnab/docker-run-action@3e77f186b7a929ef010f183a9e24c0f9955ea609
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.container }}
|
image: ${{ matrix.container }}
|
||||||
options: -v ${{ github.workspace }}:/work -w /work -e ARTIFACTORY_PUBLISH_USERNAME -e ARTIFACTORY_PUBLISH_PASSWORD -e GITHUB_REF -e CI
|
options: -v ${{ github.workspace }}:/work -w /work -e ARTIFACTORY_PUBLISH_USERNAME -e ARTIFACTORY_PUBLISH_PASSWORD -e GITHUB_REF -e CI
|
||||||
run: df . && echo $GITHUB_REF && ./gradlew build --build-cache -PbuildServer -PskipJavaFormat ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
|
run: ./gradlew build --build-cache -PbuildServer -PskipJavaFormat ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
|
||||||
env:
|
env:
|
||||||
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
ARTIFACTORY_PUBLISH_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
|
||||||
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
|
||||||
- name: Check free disk space
|
|
||||||
run: df .
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact-name }}
|
name: ${{ matrix.artifact-name }}
|
||||||
path: build/allOutputs
|
path: build/allOutputs
|
||||||
|
|
||||||
|
- name: Check disk free space
|
||||||
|
if: always()
|
||||||
|
run: df -h
|
||||||
|
|
||||||
build-host:
|
build-host:
|
||||||
env:
|
env:
|
||||||
MACOSX_DEPLOYMENT_TARGET: 13.3
|
MACOSX_DEPLOYMENT_TARGET: 13.3
|
||||||
@@ -113,6 +123,22 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: [validation]
|
needs: [validation]
|
||||||
steps:
|
steps:
|
||||||
|
- name: Check disk free space pre-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
|
- name: Free disk space (macOS)
|
||||||
|
# CodeQL: 5G
|
||||||
|
# go: 748M
|
||||||
|
# Android: 12G
|
||||||
|
run: |
|
||||||
|
rm -rf /Users/runner/hostedtoolcache/CodeQL
|
||||||
|
rm -rf /Users/runner/hostedtoolcache/go
|
||||||
|
rm -rf /Users/runner/Library/Android
|
||||||
|
if: startsWith(matrix.os, 'macOS')
|
||||||
|
|
||||||
|
- name: Check disk free space post-cleanup
|
||||||
|
run: df -h
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -139,24 +165,6 @@ jobs:
|
|||||||
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
if: startsWith(github.ref, 'refs/tags/v2027')
|
if: startsWith(github.ref, 'refs/tags/v2027')
|
||||||
- name: Check disk free space (Windows)
|
|
||||||
run: wmic logicaldisk get caption, freespace
|
|
||||||
if: matrix.os == 'windows-2022'
|
|
||||||
- name: Check disk free space pre-cleanup (macOS)
|
|
||||||
run: df -h .
|
|
||||||
if: matrix.os == 'macOS-15'
|
|
||||||
- name: Cleanup disk space
|
|
||||||
# CodeQL: 5G
|
|
||||||
# go: 748M
|
|
||||||
# Android: 12G
|
|
||||||
run: |
|
|
||||||
rm -rf /Users/runner/hostedtoolcache/CodeQL
|
|
||||||
rm -rf /Users/runner/hostedtoolcache/go
|
|
||||||
rm -rf /Users/runner/Library/Android
|
|
||||||
if: matrix.os == 'macOS-15'
|
|
||||||
- name: Check disk free space post-cleanup (macOS)
|
|
||||||
run: df -h .
|
|
||||||
if: matrix.os == 'macOS-15'
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew ${{ matrix.task }} --build-cache -PbuildServer -PskipJavaFormat ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
|
run: ./gradlew ${{ matrix.task }} --build-cache -PbuildServer -PskipJavaFormat ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
|
||||||
env:
|
env:
|
||||||
@@ -167,17 +175,15 @@ jobs:
|
|||||||
if: |
|
if: |
|
||||||
matrix.artifact-name == 'macOS' && (github.repository == 'wpilibsuite/allwpilib' &&
|
matrix.artifact-name == 'macOS' && (github.repository == 'wpilibsuite/allwpilib' &&
|
||||||
(github.ref == 'refs/heads/2027' || startsWith(github.ref, 'refs/tags/v2027')))
|
(github.ref == 'refs/heads/2027' || startsWith(github.ref, 'refs/tags/v2027')))
|
||||||
- name: Check disk free space (Windows)
|
|
||||||
run: wmic logicaldisk get caption, freespace
|
|
||||||
if: matrix.os == 'windows-2022'
|
|
||||||
- name: Check disk free space (macOS)
|
|
||||||
run: df -h .
|
|
||||||
if: matrix.os == 'macOS-15'
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.artifact-name }}
|
name: ${{ matrix.artifact-name }}
|
||||||
path: ${{ matrix.outputs }}
|
path: ${{ matrix.outputs }}
|
||||||
|
|
||||||
|
- name: Check disk free space
|
||||||
|
if: always()
|
||||||
|
run: df -h
|
||||||
|
|
||||||
build-documentation:
|
build-documentation:
|
||||||
name: "Build - Documentation"
|
name: "Build - Documentation"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -275,7 +281,7 @@ jobs:
|
|||||||
needs: [build-docker, build-host, build-documentation]
|
needs: [build-docker, build-host, build-documentation]
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Free Disk Space
|
- name: Free disk space
|
||||||
if: |
|
if: |
|
||||||
github.repository == 'wpilibsuite/allwpilib' &&
|
github.repository == 'wpilibsuite/allwpilib' &&
|
||||||
(github.ref == 'refs/heads/2027' || startsWith(github.ref, 'refs/tags/v2027'))
|
(github.ref == 'refs/heads/2027' || startsWith(github.ref, 'refs/tags/v2027'))
|
||||||
@@ -288,6 +294,7 @@ jobs:
|
|||||||
large-packages: false
|
large-packages: false
|
||||||
docker-images: false
|
docker-images: false
|
||||||
swap-storage: false
|
swap-storage: false
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
if: |
|
if: |
|
||||||
github.repository == 'wpilibsuite/allwpilib' &&
|
github.repository == 'wpilibsuite/allwpilib' &&
|
||||||
|
|||||||
3
.github/workflows/sentinel-build.yml
vendored
3
.github/workflows/sentinel-build.yml
vendored
@@ -53,11 +53,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
|
# main on 2021-05-30, to include addnab/docker-run-action/pull/17
|
||||||
uses: addnab/docker-run-action@3e77f186b7a929ef010f183a9e24c0f9955ea609
|
uses: addnab/docker-run-action@3e77f186b7a929ef010f183a9e24c0f9955ea609
|
||||||
with:
|
with:
|
||||||
image: ${{ matrix.container }}
|
image: ${{ matrix.container }}
|
||||||
options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI
|
options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI
|
||||||
run: df . && echo $GITHUB_REF && ./gradlew build -PbuildServer -PskipJavaFormat ${{ matrix.build-options }}
|
run: ./gradlew build -PbuildServer -PskipJavaFormat ${{ matrix.build-options }}
|
||||||
- name: Check free disk space
|
- name: Check free disk space
|
||||||
run: df .
|
run: df .
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user