Skip to content

Commit f6babf1

Browse files
Post-action cleanup
1 parent d3c65a8 commit f6babf1

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/cleanup.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
set -o errexit -o nounset -o xtrace -o pipefail
3+
shopt -s inherit_errexit nullglob dotglob
4+
5+
rm -rf "${HOME:?}"/* "${GITHUB_WORKSPACE:?}"/*
6+
7+
if test "${RUNNER_DEBUG:-0}" != '1'; then
8+
set +o xtrace
9+
fi

.github/workflows/build.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
if: ${{ needs.changes.outputs.buck2 == 'true' || needs.changes.outputs.grapefruit == 'true' }}
2828
runs-on: self-hosted
2929
steps:
30+
- uses: TooMuch4U/actions-clean@v2.1
3031
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
3132
- name: Check out repository code
3233
uses: actions/checkout@v4
@@ -42,12 +43,15 @@ jobs:
4243
with:
4344
name: gfruit-image
4445
path: "./buck-out/v2/gen/root/**/*"
46+
- name: Cleanup
47+
run: bash .github/cleanup.sh
4548

4649
cosmo_seq:
4750
needs: changes
4851
if: ${{ needs.changes.outputs.buck2 == 'true' || needs.changes.outputs.cosmo_seq == 'true' }}
4952
runs-on: self-hosted
5053
steps:
54+
- uses: TooMuch4U/actions-clean@v2.1
5155
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
5256
- name: Check out repository code
5357
uses: actions/checkout@v4
@@ -63,12 +67,15 @@ jobs:
6367
with:
6468
name: cosmo-seq-image
6569
path: "./buck-out/v2/gen/root/**/*"
70+
- name: Cleanup
71+
run: bash .github/cleanup.sh
6672

6773
cosmo_hp:
6874
needs: changes
6975
if: ${{ needs.changes.outputs.buck2 == 'true' || needs.changes.outputs.cosmo_hp == 'true' }}
7076
runs-on: self-hosted
7177
steps:
78+
- uses: TooMuch4U/actions-clean@v2.1
7279
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
7380
- name: Check out repository code
7481
uses: actions/checkout@v4
@@ -84,6 +91,8 @@ jobs:
8491
with:
8592
name: cosmo-hp-image
8693
path: "./buck-out/v2/gen/root/**/*"
94+
- name: Cleanup
95+
run: bash .github/cleanup.sh
8796

8897
bsv-streams:
8998
needs: changes
@@ -113,4 +122,6 @@ jobs:
113122
- uses: actions/upload-artifact@v4
114123
with:
115124
name: bsv-images
116-
path: "./build/latest/**/*"
125+
path: "./build/latest/**/*"
126+
- name: Cleanup
127+
run: bash .github/cleanup.sh

.github/workflows/simulation.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
cobble: ${{ steps.filter.outputs.cobble }}
1212
buck2: ${{ steps.filter.outputs.buck2 }}
1313
steps:
14+
- uses: TooMuch4U/actions-clean@v2.1
1415
- uses: actions/checkout@v4
1516
with:
1617
submodules: 'true'
@@ -35,6 +36,8 @@ jobs:
3536
run: echo "~/.cargo/bin" >> "$GITHUB_PATH"
3637
- name: Run VUnit tests
3738
run: set -o pipefail; buck2 bxl //tools/vunit-sims.bxl:vunit_sim_gen | while IFS= read -r line; do eval "$line" ; done
39+
- name: Cleanup
40+
run: bash .github/cleanup.sh
3841

3942
bsv-sim:
4043
needs: changes
@@ -60,4 +63,6 @@ jobs:
6063
run: ./cobble bluesim_test "//.*Test.*"
6164
working-directory: ./build
6265
- name: backup build-dir
63-
run: cp -R ./build /tmp/cobble_build_bkup
66+
run: cp -R ./build /tmp/cobble_build_bkup
67+
- name: Cleanup
68+
run: bash .github/cleanup.sh

0 commit comments

Comments
 (0)