Skip to content

Commit 6e7d5d6

Browse files
committed
ci: Enable dotglob shell option for working directory clean-up
This commit updates the CI workflow to enable the 'dotglob' shell option while cleaning up the working directories so that all contents of the working directories, including the hidden files and directories starting with a dot, are removed. Note that removing the working directory and re-creating it is not an option because that is known to break the GitHub Actions runner on the macOS. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 798295a commit 6e7d5d6

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ jobs:
362362
sudo mkdir -p ${WORKSPACE}
363363
364364
# Clean up working directories
365+
shopt -s dotglob
365366
sudo rm -rf ${GITHUB_WORKSPACE}/*
366367
sudo rm -rf ${WORKSPACE}/*
368+
shopt -u dotglob
367369
368370
# Allow non-root access to the working directories
369371
sudo chmod -R 777 ${GITHUB_WORKSPACE}
@@ -440,8 +442,10 @@ jobs:
440442
fi
441443
442444
# Clean up working directories
445+
shopt -s dotglob
443446
rm -rf ${GITHUB_WORKSPACE}/*
444447
rm -f ${RUNNER_TEMP}/Workspace.sparseimage
448+
shopt -u dotglob
445449
446450
# Create case-sensitive workspace volume for macOS
447451
hdiutil create ${RUNNER_TEMP}/Workspace.sparseimage \
@@ -731,7 +735,9 @@ jobs:
731735
if: ${{ runner.os == 'Linux' }}
732736
run: |
733737
# Clean up working directories
738+
shopt -s dotglob
734739
sudo rm -rf ${GITHUB_WORKSPACE}/*
740+
shopt -u dotglob
735741
736742
# Set environment variables
737743
echo "TAR=tar" >> $GITHUB_ENV
@@ -740,7 +746,9 @@ jobs:
740746
if: ${{ runner.os == 'macOS' }}
741747
run: |
742748
# Clean up working directories
749+
shopt -s dotglob
743750
rm -rf ${GITHUB_WORKSPACE}/*
751+
shopt -u dotglob
744752
745753
# Set environment variables
746754
echo "TAR=gtar" >> $GITHUB_ENV
@@ -819,7 +827,9 @@ jobs:
819827
if: ${{ runner.os == 'Linux' }}
820828
run: |
821829
# Clean up working directories
830+
shopt -s dotglob
822831
sudo rm -rf ${GITHUB_WORKSPACE}/*
832+
shopt -u dotglob
823833
824834
# Install common dependencies
825835
sudo apt-get update
@@ -832,7 +842,9 @@ jobs:
832842
if: ${{ runner.os == 'macOS' }}
833843
run: |
834844
# Clean up working directories
845+
shopt -s dotglob
835846
rm -rf ${GITHUB_WORKSPACE}/*
847+
shopt -u dotglob
836848
837849
# Install required dependencies if running inside a GitHub-hosted runner
838850
# (self-hosted runners are expected to provide all required dependencies)
@@ -894,7 +906,9 @@ jobs:
894906
if: ${{ runner.os == 'Linux' }}
895907
run: |
896908
# Clean up working directories
909+
shopt -s dotglob
897910
sudo rm -rf ${GITHUB_WORKSPACE}/*
911+
shopt -u dotglob
898912
899913
# Install common dependencies
900914
sudo apt-get update
@@ -907,7 +921,9 @@ jobs:
907921
if: ${{ runner.os == 'macOS' }}
908922
run: |
909923
# Clean up working directories
924+
shopt -s dotglob
910925
rm -rf ${GITHUB_WORKSPACE}/*
926+
shopt -u dotglob
911927
912928
# Install required dependencies if running inside a GitHub-hosted runner
913929
# (self-hosted runners are expected to provide all required dependencies)
@@ -1065,7 +1081,9 @@ jobs:
10651081
if: ${{ runner.os == 'Linux' }}
10661082
run: |
10671083
# Clean up working directories
1084+
shopt -s dotglob
10681085
sudo rm -rf ${GITHUB_WORKSPACE}/*
1086+
shopt -u dotglob
10691087
10701088
# Install required system packages
10711089
sudo apt-get update
@@ -1090,7 +1108,9 @@ jobs:
10901108
if: ${{ runner.os == 'macOS' }}
10911109
run: |
10921110
# Clean up working directories
1111+
shopt -s dotglob
10931112
rm -rf ${GITHUB_WORKSPACE}/*
1113+
shopt -u dotglob
10941114
10951115
# Install required system packages
10961116
brew install ccache coreutils dos2unix dtc gperf jq ninja
@@ -1112,7 +1132,9 @@ jobs:
11121132
if: ${{ runner.os == 'Windows' }}
11131133
run: |
11141134
# Clean up working directories
1135+
shopt -s dotglob
11151136
rm -rf ${GITHUB_WORKSPACE}/*
1137+
shopt -u dotglob
11161138
11171139
# Install required system packages
11181140
choco install ccache dtc-msys2 gperf jq ninja

0 commit comments

Comments
 (0)