Skip to content

Commit 20877f1

Browse files
committed
260301.084321.CST [skip ci] update test_flang.yml, handling possible timeout of installing llvm on macos-intel
1 parent 2d822c9 commit 20877f1

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/test_armflang.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,5 +106,3 @@ jobs:
106106
- name: Remove the test data
107107
if: always() # Always run even if the workflow is canceled manually or due to overtime.
108108
run: rm -rf ${{ env.TEST_DIR }}
109-
110-

.github/workflows/test_flang.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,16 @@ jobs:
7474
shell: bash
7575
run: bash .github/scripts/misc_setup
7676

77-
- name: Install LLVM Flang
77+
- name: Install LLVM Flang on non-Windows; treat timeout as SUCCESS (exit 0), which may happen on macos-intel.
78+
if: runner.os != 'Windows'
79+
uses: equipez/run-bash-command@v2
80+
with:
81+
timelimit: 320m
82+
command: |
83+
bash .github/scripts/install_llvm \
84+
|| { echo "Warning: LLVM Flang installation failed!!" >&2; exit 0; }
85+
- name: Install LLVM Flang on Windows
86+
if: runner.os == 'Windows'
7887
shell: bash
7988
run: |
8089
bash .github/scripts/install_llvm \
@@ -143,6 +152,18 @@ jobs:
143152
fi
144153
##########################################################################################
145154
155+
# On macos-intel, the installation of LLVM Flang with Homebrew may fail. If so and if the
156+
# current day is not divisible by 3, then we skip the test.
157+
if ! type flang >/dev/null 2>&1 ; then
158+
if [[ ${{ runner.os }} == macOS && ${{ runner.arch }} == X64 && $(( $(date +%-d) % 3 )) -ne 0 ]] ; then
159+
echo "Warning: flang not found!! Skipping the test." >&2
160+
exit 0
161+
else
162+
echo "Error: flang not found!! Skipping the test." >&2
163+
exit 1
164+
fi
165+
fi
166+
146167
export FFLAGS=${{ matrix.fflags }}
147168
export TESTDIM=${{ matrix.testdim }}
148169
IK=i$(( 2**(1 + $(date +%-d) % 3) ))
@@ -175,5 +196,3 @@ jobs:
175196
if: always() # Always run even if the workflow is canceled manually or due to overtime.
176197
shell: bash # Important; otherwise, `rm -rf` will not work on Windows.
177198
run: rm -rf ${{ env.TEST_DIR }}
178-
179-

0 commit comments

Comments
 (0)