Skip to content

Commit

Permalink
deps:update llgo
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Dec 3, 2024
1 parent ea06d9b commit cb4dc6e
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 66 deletions.
128 changes: 63 additions & 65 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ name: Go

on:
push:
branches: [ "**" ]
branches: ["**"]
pull_request:
branches: [ "**" ]
branches: ["**"]

jobs:

test:
strategy:
matrix:
Expand All @@ -20,65 +19,64 @@ jobs:
llvm: [18]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Install dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
brew link --force libffi
echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
# llcppg dependencies
brew install cjson
- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
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
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
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
echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
- name: Install LLGO
run: |
go install github.com/goplus/llgo/cmd/llgo@main
- name: Build
run: go build -v ./...

- name: Install llcppg dependencies
run: bash .github/workflows/install_llcppg_depend.sh

- name: Test llcppsymg
run: |
llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...
# llgo cmptest ./_xtool/llcppsymg/_cmptest/... causes
# panic: runtime error: index out of range [0] with length 0
cd _xtool/llcppsymg/_cmptest
llgo cmptest ./...
cd ../../../
- 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


- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"

- name: Install dependencies
if: startsWith(matrix.os, 'macos')
run: |
brew update
brew install llvm@${{matrix.llvm}} bdw-gc openssl libffi
brew link --force libffi
echo "$(brew --prefix llvm@${{matrix.llvm}})/bin" >> $GITHUB_PATH
# llcppg dependencies
brew install cjson
- name: Install dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
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
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
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
echo "/usr/lib/llvm-${{matrix.llvm}}/bin" >> $GITHUB_PATH
- name: Install LLGO
run: |
# Temporarily use the last commit before the issue https://github.com/goplus/llgo/issues/897 appeared:
go install github.com/goplus/llgo/cmd/llgo@7b6b8b0eeb84fb1fc9720fbb05e1c2b13600e0c1
- name: Build
run: go build -v ./...

- name: Install llcppg dependencies
run: bash .github/workflows/install_llcppg_depend.sh

- name: Test llcppsymg
run: |
llgo cmptest ./_xtool/llcppsigfetch/parse/cvt_test/...
# llgo cmptest ./_xtool/llcppsymg/_cmptest/... causes
# panic: runtime error: index out of range [0] with length 0
cd _xtool/llcppsymg/_cmptest
llgo cmptest ./...
cd ../../../
- 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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/google/go-cmp v0.6.0
github.com/goplus/gogen v1.16.3
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589
github.com/goplus/llgo v0.9.9-0.20241130054737-7b6b8b0eeb84
github.com/goplus/mod v0.13.12
)

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ github.com/goplus/gogen v1.16.3 h1:nNkV1b6zd89d/UhMb4bZHcEfdAHtPaadrJFXNcoUITI=
github.com/goplus/gogen v1.16.3/go.mod h1:6TQYbabXDF9LCdDkOOzHmfg1R4ENfXQ3XpHa9RhTSD8=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589 h1:u0aqHCN6z+Md1FYB052ROjP/6PVlFBtWWuTi/LGuifs=
github.com/goplus/llgo v0.9.8-0.20241127093550-38a7f4f7d589/go.mod h1:1phqPJEgr/uw59PRz/NB7s54OoP+NGjC6pz0HovT5JY=
github.com/goplus/llgo v0.9.9-0.20241130054737-7b6b8b0eeb84 h1:HLJLWm7UdRD3yaAXwQ/7WG8aZetFSQws+ozmeCoQHgk=
github.com/goplus/llgo v0.9.9-0.20241130054737-7b6b8b0eeb84/go.mod h1:1phqPJEgr/uw59PRz/NB7s54OoP+NGjC6pz0HovT5JY=
github.com/goplus/llgo v0.9.9-0.20241202055125-7a5bd6ae6a7f h1:Dr1wCSfVYL6n0fzQDXx/BeLF2A4D0/SB1jJ2vkLY6TQ=
github.com/goplus/llgo v0.9.9-0.20241202055125-7a5bd6ae6a7f/go.mod h1:1phqPJEgr/uw59PRz/NB7s54OoP+NGjC6pz0HovT5JY=
github.com/goplus/mod v0.13.12 h1:Trwk6j3i9VvBuW6/9ZxmkoFlEL2v3HKQu0Na1c6DAdw=
github.com/goplus/mod v0.13.12/go.mod h1:fyCcoiL02uUQK9CWxGK9pQzuJT+rZIvRKaaG+hSa2bk=
github.com/qiniu/x v1.13.10 h1:J4Z3XugYzAq85SlyAfqlKVrbf05glMbAOh+QncsDQpE=
Expand Down

0 comments on commit cb4dc6e

Please sign in to comment.