Skip to content

Commit b9701ae

Browse files
committed
CI: Use commit status to show the results of testing and go back to freeing up disk space, but only if a build is marked as "large".
1 parent 928a745 commit b9701ae

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

.github/workflows/build-brev-tutorial-docker-images.yml

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,29 @@ jobs:
5050
echo "image_name=${image_name,,}" >> $GITHUB_OUTPUT
5151
echo "tutorial_name=${tutorial_name}" >> $GITHUB_OUTPUT
5252
53+
- name: Check if build is large
54+
id: check-large
55+
run: |
56+
# Check if 'large: &large true' or 'large: true' exists in x-config section
57+
if grep -A 10 '^x-config:' "${{ matrix.tutorial }}/brev/docker-compose.yml" | grep -q 'large:.*true'; then
58+
is_large="true"
59+
else
60+
is_large="false"
61+
fi
62+
echo "is_large=${is_large}" >> $GITHUB_OUTPUT
63+
64+
- name: Free up disk space
65+
if: steps.check-large.outputs.is_large == 'true'
66+
run: |
67+
echo "Disk space before cleanup:"
68+
df -h /
69+
sudo rm -rf /usr/local/lib/android &
70+
sudo rm -rf /opt/hostedtoolcache/CodeQL &
71+
sudo rm -rf /usr/share/dotnet &
72+
wait
73+
echo "Disk space after cleanup:"
74+
df -h /
75+
5376
- name: Check for HPCCM recipe
5477
id: check-hpccm
5578
run: |
@@ -108,12 +131,26 @@ jobs:
108131
-f docker-compose.yml \
109132
base
110133
134+
- name: Create pending commit status for test
135+
run: |
136+
gh api \
137+
--method POST \
138+
-H "Accept: application/vnd.github+json" \
139+
/repos/${{ github.repository }}/statuses/${{ github.sha }} \
140+
-f state='pending' \
141+
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/workflows/test-brev-tutorial-docker-images.yml" \
142+
-f description='Test started' \
143+
-f context='test / ${{ steps.set-image.outputs.tutorial_name }}'
144+
env:
145+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146+
111147
- name: Trigger test workflow
112148
run: |
113149
echo "Triggering test for tutorial: ${{ steps.set-image.outputs.tutorial_name }}"
114150
gh workflow run test-brev-tutorial-docker-images.yml \
115151
--ref ${{ github.ref_name }} \
116-
-f tutorial=${{ steps.set-image.outputs.tutorial_name }}
152+
-f tutorial=${{ steps.set-image.outputs.tutorial_name }} \
153+
-f commit_sha=${{ github.sha }}
117154
echo "Test workflow triggered successfully"
118155
env:
119156
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tutorials/stdpar/brev/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ x-config:
22
dockerfile: &dockerfile tutorials/stdpar/brev/dockerfile
33
image: &image ghcr.io/nvidia/stdpar-tutorial:brev-reorg-latest
44
working-dir: &working-dir /accelerated-computing-hub/tutorials/stdpar/notebooks
5+
large: &large true
56

67
services:
78
base:

0 commit comments

Comments
 (0)