@@ -5,12 +5,11 @@ name: Go
55
66on :
77 push :
8- branches : [ "**" ]
8+ branches : ["**"]
99 pull_request :
10- branches : [ "**" ]
10+ branches : ["**"]
1111
1212jobs :
13-
1413 test :
1514 strategy :
1615 matrix :
@@ -20,65 +19,64 @@ jobs:
2019 llvm : [18]
2120 runs-on : ${{matrix.os}}
2221 steps :
23- - uses : actions/checkout@v4
24-
25- - name : Set up Go
26- uses : actions/setup-go@v4
27- with :
28- go-version : ' 1.20'
29-
30- - name : Install dependencies
31- if : startsWith(matrix.os, 'macos')
32- run : |
33- brew update
34- brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
35- brew link --force libffi
36- echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
37-
38- # llcppg dependencies
39- brew install cjson
40-
41- - name : Install dependencies
42- if : startsWith(matrix.os, 'ubuntu')
43- run : |
44- 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
45- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
46- sudo apt-get update
47- sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} libclang-${{matrix.llvm}}-dev lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev
48- echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
49-
50- - name : Install LLGO
51- run : |
52- go install github.com/goplus/llgo/cmd/llgo@main
53-
54- - name : Build
55- run : go build -v ./...
56-
57- - name : Install llcppg dependencies
58- run : bash .github/workflows/install_llcppg_depend.sh
59-
60- - name : Test llcppsymg
61- run : |
62- llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...
63-
64- # llgo cmptest ./_xtool/llcppsymg/_cmptest/... causes
65- # panic: runtime error: index out of range [0] with length 0
66- cd _xtool/llcppsymg/_cmptest
67- llgo cmptest ./...
68- cd ../../../
69-
70- - name : Test
71- if : ${{!startsWith(matrix.os, 'macos')}}
72- run : go test -v ./...
73-
74- - name : Test with coverage
75- if : startsWith(matrix.os, 'macos')
76- run : go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
77-
78- - name : Upload coverage reports to Codecov
79- uses : codecov/codecov-action@v5
80- with :
81- token : ${{secrets.CODECOV_TOKEN}}
82- slug : goplus/llcppg
83-
84-
22+ - uses : actions/checkout@v4
23+
24+ - name : Set up Go
25+ uses : actions/setup-go@v4
26+ with :
27+ go-version : " 1.20"
28+
29+ - name : Install dependencies
30+ if : startsWith(matrix.os, 'macos')
31+ run : |
32+ brew update
33+ brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
34+ brew link --force libffi
35+ echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
36+
37+ # llcppg dependencies
38+ brew install cjson
39+
40+ - name : Install dependencies
41+ if : startsWith(matrix.os, 'ubuntu')
42+ run : |
43+ 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
44+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
45+ sudo apt-get update
46+ sudo apt-get install -y llvm-${{matrix.llvm}}-dev clang-${{matrix.llvm}} libclang-${{matrix.llvm}}-dev lld-${{matrix.llvm}} pkg-config libgc-dev libssl-dev zlib1g-dev libffi-dev libcjson-dev
47+ echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
48+
49+ - name : Install LLGO
50+ run : |
51+ # Temporarily use the last commit before the issue https://github.com/goplus/llgo/issues/897 appeared:
52+ go install github.com/goplus/llgo/cmd/llgo@7b6b8b0eeb84fb1fc9720fbb05e1c2b13600e0c1
53+
54+ - name : Build
55+ run : go build -v ./...
56+
57+ - name : Install llcppg dependencies
58+ run : bash .github/workflows/install_llcppg_depend.sh
59+
60+ - name : Test llcppsymg
61+ run : |
62+ llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...
63+
64+ # llgo cmptest ./_xtool/llcppsymg/_cmptest/... causes
65+ # panic: runtime error: index out of range [0] with length 0
66+ cd _xtool/llcppsymg/_cmptest
67+ llgo cmptest ./...
68+ cd ../../../
69+
70+ - name : Test
71+ if : ${{!startsWith(matrix.os, 'macos')}}
72+ run : go test -v ./...
73+
74+ - name : Test with coverage
75+ if : startsWith(matrix.os, 'macos')
76+ run : go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
77+
78+ - name : Upload coverage reports to Codecov
79+ uses : codecov/codecov-action@v5
80+ with :
81+ token : ${{secrets.CODECOV_TOKEN}}
82+ slug : goplus/llcppg
0 commit comments