Skip to content

Commit de13264

Browse files
Better cleanup strategy for GH Actions CI
Before each GH Actions job, remove everything from: - The working directory (where the Dotty repo is cloned) - The temp directory - The user home directory These directories are mounted by Docker before the workflow is started and hence can be persisted between different CI runs and we don't want that. The list of the directories can be obtained by looking at the `docker create` command that the "Initialize containers" step runs for each job of the CI. Only volumes that are vital for CI functioning are spared during the cleanup.
1 parent faa26c6 commit de13264

File tree

1 file changed

+56
-14
lines changed

1 file changed

+56
-14
lines changed

.github/workflows/ci.yaml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ jobs:
1515
container: akmetiuk/dotty:2020-02-12
1616

1717
steps:
18-
- name: Clean Workspace
19-
uses: anatoliykmetyuk/action-clean@1.0.2
18+
- name: Cleanup
19+
run: |
20+
TARGETS="$(pwd) /__w/_temp /github/home"
21+
for folder in $TARGETS; do
22+
echo "Cleaning $folder"
23+
cd $folder
24+
rm -rf ..?* .[!.]* *
25+
done
2026
2127
- name: Git Checkout
2228
uses: actions/checkout@v2
@@ -52,8 +58,14 @@ jobs:
5258
container: akmetiuk/dotty:2020-02-12
5359

5460
steps:
55-
- name: Clean Workspace
56-
uses: anatoliykmetyuk/action-clean@1.0.2
61+
- name: Cleanup
62+
run: |
63+
TARGETS="$(pwd) /__w/_temp /github/home"
64+
for folder in $TARGETS; do
65+
echo "Cleaning $folder"
66+
cd $folder
67+
rm -rf ..?* .[!.]* *
68+
done
5769
5870
- name: Git Checkout
5971
uses: actions/checkout@v2
@@ -89,8 +101,14 @@ jobs:
89101
container: akmetiuk/dotty:2020-02-12
90102

91103
steps:
92-
- name: Clean Workspace
93-
uses: anatoliykmetyuk/action-clean@1.0.2
104+
- name: Cleanup
105+
run: |
106+
TARGETS="$(pwd) /__w/_temp /github/home"
107+
for folder in $TARGETS; do
108+
echo "Cleaning $folder"
109+
cd $folder
110+
rm -rf ..?* .[!.]* *
111+
done
94112
95113
- name: Git Checkout
96114
uses: actions/checkout@v2
@@ -132,8 +150,14 @@ jobs:
132150
github.event_name == 'schedule'
133151

134152
steps:
135-
- name: Clean Workspace
136-
uses: anatoliykmetyuk/action-clean@1.0.2
153+
- name: Cleanup
154+
run: |
155+
TARGETS="$(pwd) /__w/_temp /github/home"
156+
for folder in $TARGETS; do
157+
echo "Cleaning $folder"
158+
cd $folder
159+
rm -rf ..?* .[!.]* *
160+
done
137161
138162
- name: Git Checkout
139163
uses: actions/checkout@v2
@@ -172,8 +196,14 @@ jobs:
172196
github.event_name == 'schedule'
173197

174198
steps:
175-
- name: Clean Workspace
176-
uses: anatoliykmetyuk/action-clean@1.0.2
199+
- name: Cleanup
200+
run: |
201+
TARGETS="$(pwd) /__w/_temp /github/home"
202+
for folder in $TARGETS; do
203+
echo "Cleaning $folder"
204+
cd $folder
205+
rm -rf ..?* .[!.]* *
206+
done
177207
178208
- name: Git Checkout
179209
uses: actions/checkout@v2
@@ -217,8 +247,14 @@ jobs:
217247
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
218248

219249
steps:
220-
- name: Clean Workspace
221-
uses: anatoliykmetyuk/action-clean@1.0.2
250+
- name: Cleanup
251+
run: |
252+
TARGETS="$(pwd) /__w/_temp /github/home"
253+
for folder in $TARGETS; do
254+
echo "Cleaning $folder"
255+
cd $folder
256+
rm -rf ..?* .[!.]* *
257+
done
222258
223259
- name: Git Checkout
224260
uses: actions/checkout@v2
@@ -260,8 +296,14 @@ jobs:
260296
# Make sure you have the write permissions to the repo: https://github.com/lampepfl/dotty-website
261297

262298
steps:
263-
- name: Clean Workspace
264-
uses: anatoliykmetyuk/action-clean@1.0.2
299+
- name: Cleanup
300+
run: |
301+
TARGETS="$(pwd) /__w/_temp /github/home"
302+
for folder in $TARGETS; do
303+
echo "Cleaning $folder"
304+
cd $folder
305+
rm -rf ..?* .[!.]* *
306+
done
265307
266308
- name: Git Checkout
267309
uses: actions/checkout@v2

0 commit comments

Comments
 (0)