Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add workaround to prevent "no space left on device" error #3172

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/actions/free-runner-disk-space-ubuntu/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Free disk space on Ubuntu runner'
description: 'Remove unused cached tools, to free disk space'

runs:
using: composite
steps:
#
# https://github.com/actions/runner-images/issues/2840#issuecomment-2272410832 (2024-08-07), taking implementation done in https://github.com/cilium/cilium/commit/e553bd23443ef14c8cbbeeafa7ebab3bb30c3fac and remove only tools that we don't use
# We may also use https://github.com/jlumbroso/free-disk-space mentioned in https://github.com/actions/runner-images/issues/2875#issuecomment-1163363045
- name: Free up disk space
shell: bash
run: |
echo "Disk space before cleanup..."
df -kh
echo "Removing unnecessary files to free up disk space..."
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
echo "Disk space after cleanup..."
df -kh
16 changes: 16 additions & 0 deletions .github/actions/log-disk-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: 'Log disk space'
description: 'Log disk space (for troubleshooting)'

runs:
using: "composite"

steps:
- name: Log disk space on Unix based OS
shell: bash
if: runner.os != 'Windows'
run: df -kh
- name: Log disk space on Windows
shell: pwsh
if: runner.os == 'Windows'
run: Get-Volume

8 changes: 8 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,25 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Free disk space on Ubuntu runner
if: runner.os == 'Linux'
uses: ./.github/actions/free-runner-disk-space-ubuntu
- name: Build Setup
uses: ./.github/actions/build-setup
- name: Install ${{matrix.browser}}
uses: ./.github/actions/install-playwright-browser
with:
browser: ${{matrix.browser}}
- name: Log disk space
uses: ./.github/actions/log-disk-space
- name: Test Application End to End
id: 'test_e2e'
env:
BROWSERS: ${{matrix.browser}}
run: npm run test:e2e:verbose
- name: Log disk space
uses: ./.github/actions/log-disk-space
if: always()
- name: Upload e2e test results
if: ${{ failure() && steps.test_e2e.outcome == 'failure' }}
uses: actions/upload-artifact@v4
Expand Down
Loading