Skip to content

Commit a509d66

Browse files
7408647nphkahler
authored andcommitted
Fix: macOS test action not work
1 parent de2c5fe commit a509d66

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/scripts/install-macos.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
#!/bin/sh -xe
2+
set -o pipefail
23

34
if [ "$1" = "ci" ]; then
4-
armloc=$(brew fetch --bottle-tag=arm64_sequoia libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:)
5-
x64loc=$(brew fetch --bottle-tag=sequoia libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:)
6-
cp $armloc /tmp/libomp-arm64.tar.gz
5+
brew_cache=$(brew --cache)
6+
brew fetch --bottle-tag=arm64_tahoe libomp >/dev/null
7+
brew fetch --bottle-tag=sonoma libomp >/dev/null
8+
armloc=$(find "$brew_cache"/downloads -maxdepth 1 -name "*--libomp--*arm64_tahoe.bottle.tar.gz" -print | tail -n1)
9+
x64loc=$(find "$brew_cache"/downloads -maxdepth 1 -name "*--libomp--*sonoma.bottle.tar.gz" -print | tail -n1)
10+
[ -n "$armloc" ] || { echo "Failed to locate arm64 libomp bottle in cache" >&2; exit 1; }
11+
[ -n "$x64loc" ] || { echo "Failed to locate x86_64 libomp bottle in cache" >&2; exit 1; }
12+
cp "$armloc" /tmp/libomp-arm64.tar.gz
713
mkdir /tmp/libomp-arm64 || true
814
tar -xzvf /tmp/libomp-arm64.tar.gz -C /tmp/libomp-arm64
9-
cp $x64loc /tmp/libomp-x86_64.tar.gz
15+
cp "$x64loc" /tmp/libomp-x86_64.tar.gz
1016
mkdir /tmp/libomp-x86_64 || true
1117
tar -xzvf /tmp/libomp-x86_64.tar.gz -C /tmp/libomp-x86_64
1218
else

0 commit comments

Comments
 (0)