|
50 | 50 | echo "image_name=${image_name,,}" >> $GITHUB_OUTPUT |
51 | 51 | echo "tutorial_name=${tutorial_name}" >> $GITHUB_OUTPUT |
52 | 52 |
|
| 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 | +
|
53 | 76 | - name: Check for HPCCM recipe |
54 | 77 | id: check-hpccm |
55 | 78 | run: | |
@@ -108,12 +131,26 @@ jobs: |
108 | 131 | -f docker-compose.yml \ |
109 | 132 | base |
110 | 133 |
|
| 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 | + |
111 | 147 | - name: Trigger test workflow |
112 | 148 | run: | |
113 | 149 | echo "Triggering test for tutorial: ${{ steps.set-image.outputs.tutorial_name }}" |
114 | 150 | gh workflow run test-brev-tutorial-docker-images.yml \ |
115 | 151 | --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 }} |
117 | 154 | echo "Test workflow triggered successfully" |
118 | 155 | env: |
119 | 156 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments