@@ -15,54 +15,60 @@ jobs:
15
15
strategy :
16
16
matrix :
17
17
os : [macos-latest, ubuntu-latest]
18
- llvm : [17]
18
+ llvm : [17, 18]
19
+ exclude :
20
+ - os : ubuntu-latest
21
+ llvm : 18
19
22
runs-on : ${{ matrix.os }}
20
23
steps :
21
24
- uses : actions/checkout@v4
22
25
23
26
- name : Update Homebrew
24
27
# needed as long as LLVM 17 is still fresh
25
- if : matrix.llvm == 17 && startsWith(matrix.os, 'macos')
28
+ if : startsWith(matrix.os, 'macos')
26
29
run : brew update
27
- - name : Install LLVM ${{ matrix.llvm }} and bdw-gc
30
+ - name : Install LLVM ${{ matrix.llvm }} and bdw-gc on macOS
28
31
if : startsWith(matrix.os, 'macos')
29
32
run : |
30
33
HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.llvm }} bdw-gc
31
34
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
33
36
if : startsWith(matrix.os, 'ubuntu')
34
37
run : |
35
38
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
36
39
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
37
40
sudo apt-get update
38
41
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
39
42
echo /usr/lib/llvm-${{ matrix.llvm }}/bin >> $GITHUB_PATH
40
-
43
+
41
44
- name : Clang information
42
45
run : |
43
46
echo $PATH
44
47
which clang
45
48
clang --version
46
-
49
+
47
50
- name : Set up Go
48
51
uses : actions/setup-go@v5
49
52
with :
50
53
go-version : ' 1.20'
51
54
52
55
- 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 ./...
58
57
59
58
- 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 ./...
62
68
63
69
- name : Install
64
- run : go install ./...
65
-
70
+ run : go install -tags=llvm${{ matrix.llvm }} ./...
71
+
66
72
- name : LLGO tests
67
73
if : matrix.os != 'ubuntu-latest'
68
74
run : |
74
80
set +e
75
81
LLGOROOT=$PWD bash .github/workflows/test_demo.sh
76
82
exit 0
77
-
83
+
78
84
- name : Show test result
79
85
run : cat result.md
80
86
0 commit comments