-
Notifications
You must be signed in to change notification settings - Fork 11
83 lines (71 loc) · 2.43 KB
/
Copy pathgo.yml
File metadata and controls
83 lines (71 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
jobs:
test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-24.04
llvm: [19]
llgo: [f0728c4fe028fbc72455c1242cef638ebdf60454]
go: [1.23]
fail-fast: false
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4
- name: Setup llcppg environment
uses: ./.github/actions/setup-llcppg
with:
go: ${{ matrix.go }}
llvm: ${{ matrix.llvm }}
llgo: ${{ matrix.llgo }}
- name: Setup Test Dependencies
if: startsWith(matrix.os, 'macos')
run: brew install cjson
- name: Setup Test Dependencies
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt install libcjson-dev
- name: Test xtool
run: |
# llgo test ./_xtool/internal/parser/...
# got go/bin/parser.test: exit code -1
# check exit code outout for temporary fix
# with the latest update can exit in llgo test
# only with llgo test ./... with llgo update
# https://github.com/goplus/llgo/pull/1128
llgo test ./_xtool/internal/...
llgo test ./config
- name: Test llcppsymg & llcppsigfetch
run: |
llgo test ./_xtool/llcppsigfetch/internal/...
llgo test ./_xtool/llcppsymg/internal/...
- name: Test
if: ${{!startsWith(matrix.os, 'macos')}}
run: go test -v ./...
- name: Test with coverage
if: startsWith(matrix.os, 'macos')
run: go test -v -coverprofile="coverage.txt" -covermode=atomic ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{secrets.CODECOV_TOKEN}}
slug: goplus/llcppg
- name: Test demos
run: |
# TODO(lijie): force python3-embed to be linked with python-3.12-embed
# Currently, python3-embed is python-3.13-embed, doesn't work with pytorch
# Will remove this after pytorch is fixed.
pcdir=$HOME/pc
mkdir -p $pcdir
libdir=$(pkg-config --variable=libdir python-3.12-embed)
echo "libdir: $libdir"
ln -s $libdir/pkgconfig/python-3.12-embed.pc $pcdir/python3-embed.pc
export PKG_CONFIG_PATH=$pcdir
bash .github/workflows/test_demo.sh