Skip to content

Commit

Permalink
ci: LLVM install falls back to binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
alandefreitas committed Jun 11, 2024
1 parent bd4cbad commit 76ff85d
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ jobs:
id: llvm-parameters
run: |
echo -E "llvm-hash=7a28a5b3fee6c78ad59af79a3d03c00db153c49f" >> $GITHUB_OUTPUT
echo -E "llvm-id=7a28a5b3" >> $GITHUB_OUTPUT
echo -E "llvm-build-preset=${{ runner.os == 'Windows' && 'release-win' || 'release-unix' }}" >> $GITHUB_OUTPUT
cd ..
llvm_root=$(pwd)/third-party/llvm-project/install
Expand Down Expand Up @@ -227,7 +228,29 @@ jobs:
cmake --build ./build --target help
fi
N_CORES=$(nproc 2>/dev/null || echo 1)
cmake --build ./build --config Release --parallel $N_CORES
if [ ${{ runner.os }} != 'Windows' ]; then
cmake --build ./build --config Release --parallel $N_CORES
else
# Allow build step to fail
set +e
cmake --build ./build --config Release --parallel $N_CORES
exit_code=$?
set -e
if [ $exit_code -ne 0 ]; then
echo "Could not build LLVM in CI. Fetching pre-built binaries from mrdocs.com."
cd ..
llvm_archive_filename="Windows-Release-${{ steps.llvm-parameters.outputs.llvm-id }}.7z"
llvm_url="https://mrdocs.com/llvm+clang/$llvm_archive_filename"
curl -L -o "$llvm_archive_filename" "$llvm_url"
7z x "$llvm_archive_filename"
cd "Release"
mkdir -p "$llvm_project_root"/install
mv * "$llvm_project_root"/install
cd ..
rm -rf "Release"
exit 0
fi
fi
cmake --install ./build --prefix "$llvm_project_root"/install
- name: Install Node.js
Expand Down

0 comments on commit 76ff85d

Please sign in to comment.