CI: Reclaim space after package operations
Rather than reclaiming space before updating the packages do
it afterwards. This avoids issues with apt returning an
error due to missing files on the system.
This commit includes a revert for 6320b9e6
.
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #14387
This commit is contained in:
parent
7a85f58db6
commit
07281f7d13
|
@ -1,19 +1,20 @@
|
||||||
#!/bin/sh -x
|
#!/bin/sh
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# remove 4GiB of images
|
# remove 4GiB of images
|
||||||
sudo systemd-run docker system prune --force --all --volumes
|
sudo systemd-run docker system prune --force --all --volumes
|
||||||
|
|
||||||
# remove unused packages
|
|
||||||
sudo apt remove -q --purge firefox
|
|
||||||
|
|
||||||
# remove unused software
|
# remove unused software
|
||||||
sudo systemd-run rm -rf \
|
sudo systemd-run rm -rf \
|
||||||
"$AGENT_TOOLSDIRECTORY" \
|
"$AGENT_TOOLSDIRECTORY" \
|
||||||
/opt/* \
|
/opt/* \
|
||||||
/usr/local/* \
|
/usr/local/* \
|
||||||
/usr/share/az* \
|
/usr/share/az* \
|
||||||
|
/usr/share/dotnet \
|
||||||
/usr/share/gradle* \
|
/usr/share/gradle* \
|
||||||
/usr/share/miniconda \
|
/usr/share/miniconda \
|
||||||
/usr/share/swift
|
/usr/share/swift \
|
||||||
|
/var/lib/gems \
|
||||||
|
/var/lib/mysql \
|
||||||
|
/var/lib/snapd
|
||||||
|
|
|
@ -15,9 +15,6 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Reclaim disk space
|
|
||||||
run: |
|
|
||||||
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
@ -58,8 +55,9 @@ jobs:
|
||||||
- name: Clear the kernel ring buffer
|
- name: Clear the kernel ring buffer
|
||||||
run: |
|
run: |
|
||||||
sudo dmesg -c >/var/tmp/dmesg-prerun
|
sudo dmesg -c >/var/tmp/dmesg-prerun
|
||||||
- name: Report disk space
|
- name: Reclaim and report disk space
|
||||||
run: |
|
run: |
|
||||||
|
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
||||||
df -h /
|
df -h /
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -11,9 +11,6 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
- name: Reclaim disk space
|
|
||||||
run: |
|
|
||||||
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
|
@ -54,8 +51,9 @@ jobs:
|
||||||
- name: Clear the kernel ring buffer
|
- name: Clear the kernel ring buffer
|
||||||
run: |
|
run: |
|
||||||
sudo dmesg -c >/var/tmp/dmesg-prerun
|
sudo dmesg -c >/var/tmp/dmesg-prerun
|
||||||
- name: Report disk space
|
- name: Reclaim and report disk space
|
||||||
run: |
|
run: |
|
||||||
|
${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
|
||||||
df -h /
|
df -h /
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in New Issue