Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ksperling-apple committed Feb 28, 2024
1 parent 6d8613d commit bfef536
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/actions/checkout-submodules-and-bootstrap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ inputs:
runs:
using: "composite"
steps:
- name: Maximize runner disk
uses: ./.github/actions/maximize-runner-disk
- name: Dump disk info
uses: ./.github/actions/dump-disk-info
- name: Set git safe directory for local act runs
Expand Down
32 changes: 32 additions & 0 deletions .github/actions/maximize-runner-disk/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Maximize runner disk
description: Free up disk space on the github runner
runs:
using: "composite"
steps:
- name: Free up disk space on the github runner
if: ${{ !env.ACT }}
shell: bash
run: |
# maximize-runner-disk
if [[ "$RUNNER_OS" == Linux ]]; then
# Directories to prune to free up space
prune=(/usr/local/lib/android)
if [[ "$UID" -eq 0 && -d /__w ]]; then
root=/runner-root-volume
if [[ ! -d "$root" ]]; then
echo "Unable to maximize disk space, job is running inside a container and $root is not mounted"
exit 0
fi
function sudo() { "$@"; } # we're already root (and sudo is probably unavailable)
elif [[ "$UID" -ne 0 && "$RUNNER_ENVIRONMENT" == github-hosted ]]; then
root=
else
echo "Unable to maximize disk space, unknown runner environment"
exit 0
fi
echo "Freeing up runner disk space:"
du -sh -- "${prune[@]}"
sudo rm -rf -- "${prune[@]}"
fi
17 changes: 11 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ jobs:
runs-on: ubuntu-latest
if: github.actor != 'restyled-io[bot]'

container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
# container:
# image: ghcr.io/project-chip/chip-build:35
# volumes:
# - "/:/runner-root-volume"
# - "/tmp/log_output:/tmp/test_logs"
# options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
# net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"

steps:
- name: Dump GitHub context
Expand Down Expand Up @@ -137,6 +138,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -285,6 +287,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -345,6 +348,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down Expand Up @@ -453,6 +457,7 @@ jobs:
container:
image: ghcr.io/project-chip/chip-build:35
volumes:
- "/:/runner-root-volume"
- "/tmp/log_output:/tmp/test_logs"
options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0
net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1"
Expand Down

0 comments on commit bfef536

Please sign in to comment.