Skip to content

Commit 00bb241

Browse files
committed
ci: add llvm18 to ci matrix
1 parent 25080b5 commit 00bb241

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

.github/workflows/go.yml

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,60 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [macos-latest, ubuntu-latest]
18-
llvm: [17]
18+
llvm: [17, 18]
19+
exclude:
20+
- os: ubuntu-latest
21+
llvm: 18
1922
runs-on: ${{ matrix.os }}
2023
steps:
2124
- uses: actions/checkout@v4
2225

2326
- name: Update Homebrew
2427
# needed as long as LLVM 17 is still fresh
25-
if: matrix.llvm == 17 && startsWith(matrix.os, 'macos')
28+
if: startsWith(matrix.os, 'macos')
2629
run: brew update
27-
- name: Install LLVM ${{ matrix.llvm }} and bdw-gc
30+
- name: Install LLVM ${{ matrix.llvm }} and bdw-gc on macOS
2831
if: startsWith(matrix.os, 'macos')
2932
run: |
3033
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.llvm }} bdw-gc
3134
echo `brew --prefix llvm@${{ matrix.llvm }}`/bin >> $GITHUB_PATH
32-
- name: Install LLVM ${{ matrix.llvm }} and libgc-dev
35+
- name: Install LLVM ${{ matrix.llvm }} and libgc-dev on Ubuntu
3336
if: startsWith(matrix.os, 'ubuntu')
3437
run: |
3538
echo "deb http://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${{ matrix.llvm }} main" | sudo tee /etc/apt/sources.list.d/llvm.list
3639
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
3740
sudo apt-get update
3841
sudo apt-get install -y llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }} lld-${{ matrix.llvm }} pkg-config libgc-dev libcjson-dev libsqlite3-dev python3.11-dev
3942
echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
40-
43+
4144
- name: Clang information
4245
run: |
4346
echo $PATH
4447
which clang
4548
clang --version
46-
49+
4750
- name: Set up Go
4851
uses: actions/setup-go@v5
4952
with:
5053
go-version: '1.20'
5154

5255
- name: Build
53-
run: go build -v ./...
54-
55-
- name: Test
56-
if: matrix.os != 'macos-latest'
57-
run: go test -v ./...
56+
run: go build -tags=llvm${{ matrix.llvm }} -v ./...
5857

5958
- name: Test with coverage
60-
if: matrix.os == 'macos-latest'
61-
run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
59+
id: test
60+
if: matrix.os == 'macos-latest' && matrix.llvm == 18
61+
run: |
62+
go test -tags=llvm${{ matrix.llvm }} -v -coverprofile="coverage.txt" -covermode=atomic ./...
63+
echo "tested=1" >> $GITHUB_OUTPUT
64+
65+
- name: Test
66+
if: steps.test.outputs.tested != '1'
67+
run: go test -tags=llvm${{ matrix.llvm }} -v ./...
6268

6369
- name: Install
64-
run: go install ./...
65-
70+
run: go install -tags=llvm${{ matrix.llvm }} ./...
71+
6672
- name: LLGO tests
6773
if: matrix.os != 'ubuntu-latest'
6874
run: |
@@ -74,7 +80,7 @@ jobs:
7480
set +e
7581
LLGOROOT=$PWD bash .github/workflows/test_demo.sh
7682
exit 0
77-
83+
7884
- name: Show test result
7985
run: cat result.md
8086

0 commit comments

Comments
 (0)