Skip to content

Commit

Permalink
ci: Use prebuilt clang binaries on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpfard committed Sep 3, 2023
1 parent 5b5fc6e commit c4b268b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,22 @@ jobs:
# ninja version to download. Default: 1.10.0
version: 1.10.0
dest: ${{ github.workspace }}/ninja_bin

- name: Add prebuilt llvm install dir to PATH
run: |
"${{ github.workspace }}/llvm-install-${{ env.LLVM_VER }}/bin\n" + (Get-Content $env:GITHUB_PATH -Raw) | Set-Content $env:GITHUB_PATH
Add-Content $env:GITHUB_ENV "CXX_COMPILER_BIN=${{ github.workspace }}/llvm-install-${{ env.LLVM_VER }}/bin"
- name: Configure CMake
env:
CMAKE_PREFIX_PATH: ${{ github.workspace }}/llvm-install-${{ env.LLVM_VER }}
run: cmake -B build -G Ninja -DFINAL_STAGE=1 -DCMAKE_CXX_COMPILER=clang.exe -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=jakt-install
run: cmake -B build -G Ninja -DFINAL_STAGE=1 -DCMAKE_CXX_COMPILER=clang -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=jakt-install

- name: Build Jakt Stage 1 Selfhost
run: cmake --build build

- name: Test Jakt Stage 1
run: .\build\bin\jakttest.exe
run: .\build\bin\jakttest.exe --cpp-compiler "$env:CXX_COMPILER_BIN/clang++.exe"

# FIXME: Share this better with unix job?
- name: Install jakt
Expand All @@ -151,7 +157,7 @@ jobs:
run: |
./jakt-install/bin/jakt.exe --create TestProjectJakt
cd TestProjectJakt
../jakt-install/bin/jakt.exe -O src/main.jakt -o TestProjectJakt
../jakt-install/bin/jakt.exe -O src/main.jakt -o TestProjectJakt -C "$CXX_COMPILER_BIN/clang-cl"
if ! ./build/TestProjectJakt.exe | grep -q "Hello, World!";
then
echo "::error :^( failed, failing job"
Expand All @@ -161,6 +167,7 @@ jobs:
working-directory: ${{ github.workspace }}
shell: bash
run: |
export PATH="$CXX_COMPILER_BIN:$PATH"
./jakt-install/bin/jakt.exe --create TestProjectCMake
cd TestProjectCMake
cmake -GNinja -B build \
Expand Down

0 comments on commit c4b268b

Please sign in to comment.