ci(disk usage): disk related fixes and improvements (#1524)

ci(workflow): show disk usage and free up disk space used by unneeded tooling
ci(tests): routes tests: do not copy large images if they are not used later
ci(trivy): update a test: download trivy.db to a temporary folder

Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
Andrei Aaron
2023-06-16 01:07:28 +03:00
committed by GitHub
parent 988ca427b5
commit f9f9422d13
4 changed files with 52 additions and 7 deletions
+43 -1
View File
@@ -32,14 +32,21 @@ jobs:
os: [linux, darwin]
arch: [amd64, arm64]
steps:
- name: Remove unneeded tooling
run: |
# To free up ~15 GB of disk space
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
- name: Install go
uses: actions/setup-go@v4
with:
cache: false
go-version: 1.20.x
- name: Check out source code
uses: actions/checkout@v3
- name: Cache go dependencies
id: cache-go-dependencies
uses: actions/cache@v3
@@ -94,6 +101,23 @@ jobs:
env:
AWS_ACCESS_KEY_ID: fake
AWS_SECRET_ACCESS_KEY: fake
- name: Check disk space before build
run: |
cd $GITHUB_WORKSPACE
set -x
df -h
sudo ls -lRh /tmp/* || true
sudo du -sh /tmp || true
sudo du -sh /tmp/* || true
sudo find /tmp/ -size +5M | sudo xargs ls -lh
du -sh ./* || true
find ./ -size +5M | xargs ls -lh
sudo du -sh /var/
sudo du -sh /var/lib/docker/
du -sh /home/runner/work/
set +x
- name: Run build and test
timeout-minutes: 80
run: |
@@ -112,6 +136,24 @@ jobs:
AWS_SECRET_ACCESS_KEY: fake
OS: ${{ matrix.os }}
ARCH: ${{ matrix.arch }}
- name: Check disk space after build
if: always()
run: |
cd $GITHUB_WORKSPACE
set -x
df -h
sudo ls -lRh /tmp/* || true
sudo du -sh /tmp || true
sudo du -sh /tmp/* || true
sudo find /tmp/ -size +5M | sudo xargs ls -lh
du -sh ./* || true
find ./ -size +5M | xargs ls -lh
sudo du -sh /var/
sudo du -sh /var/lib/docker/
du -sh /home/runner/work/
set +x
- name: Upload code coverage
uses: codecov/codecov-action@v3
with: