Skip to content

Commit 848cd15

Browse files
committed
ci:before release test binaries
1 parent f97d2d7 commit 848cd15

File tree

4 files changed

+44
-31
lines changed

4 files changed

+44
-31
lines changed

.github/workflows/go.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -119,31 +119,9 @@ jobs:
119119
120120
- name: Test demos with generated pkgs
121121
if: startsWith(matrix.os, 'macos')
122-
run: |
123-
# install demo's lib
124-
brew install lua zlib isl libgpg-error raylib z3 sqlite3 gmp libxml2 libxslt
125-
126-
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
127-
export PKG_CONFIG_PATH="/opt/homebrew/opt/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH"
128-
export PKG_CONFIG_PATH="/opt/homebrew/opt/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH"
129-
export PKG_CONFIG_PATH="/opt/homebrew/opt/libxslt/lib/pkgconfig:$PKG_CONFIG_PATH"
130-
pkg-config --cflags --libs sqlite3
131-
pkg-config --cflags --libs libxslt
132-
133-
llcppgtest -demos ./_llcppgtest
122+
run: bash .github/workflows/test_macos.sh
123+
134124

135125
- name: Test demos with generated pkgs
136126
if: startsWith(matrix.os, 'ubuntu')
137-
run: |
138-
# install demo's lib
139-
sudo apt install liblua5.4-dev libsqlite3-dev libgmp-dev libgpg-error-dev zlib1g-dev libisl-dev libz3-dev -y
140-
llcppgtest -demo ./_llcppgtest/cjson -conf conf/linux
141-
llcppgtest -demo ./_llcppgtest/gmp -conf conf/linux
142-
llcppgtest -demo ./_llcppgtest/gpgerror -conf conf/linux
143-
llcppgtest -demo ./_llcppgtest/isl
144-
llcppgtest -demo ./_llcppgtest/lua -conf conf/linux
145-
llcppgtest -demo ./_llcppgtest/sqlite -conf conf/linux
146-
llcppgtest -demo ./_llcppgtest/z3 -conf conf/linux
147-
llcppgtest -demo ./_llcppgtest/zlib -conf conf/linux
148-
149-
127+
run: bash .github/workflows/test_linux.sh

.github/workflows/release.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,30 @@ jobs:
5353
echo "LLGO_ROOT=$LLGO_ROOT" >> $GITHUB_ENV
5454
- name: Build components
5555
run: |
56-
mkdir -p build/${{matrix.platform}}-${{matrix.arch}}
56+
BINDIR="$GITHUB_WORKSPACE/build/${{matrix.platform}}-${{matrix.arch}}"
57+
mkdir -p $BINDIR
5758
cd $GITHUB_WORKSPACE
58-
llgo build -o build/${{matrix.platform}}-${{matrix.arch}}/llcppsymg ./_xtool/llcppsymg
59-
llgo build -o build/${{matrix.platform}}-${{matrix.arch}}/llcppsigfetch ./_xtool/llcppsigfetch
60-
go build -o build/${{matrix.platform}}-${{matrix.arch}}/gogensig ./cmd/gogensig
61-
go build -o build/${{matrix.platform}}-${{matrix.arch}}/llcppg .
62-
go build -o build/${{matrix.platform}}-${{matrix.arch}}/llcppcfg ./cmd/llcppcfg
59+
llgo build -o $BINDIR/llcppsymg ./_xtool/llcppsymg
60+
llgo build -o $BINDIR/llcppsigfetch ./_xtool/llcppsigfetch
61+
go build -o $BINDIR/gogensig ./cmd/gogensig
62+
go build -o $BINDIR/llcppg .
63+
go build -o $BINDIR/llcppcfg ./cmd/llcppcfg
6364
cd build
6465
zip -r llcppg-${{matrix.platform}}-${{matrix.arch}}.zip ${{matrix.platform}}-${{matrix.arch}}/
66+
67+
- name: Prepare llcppg binaries test
68+
run: |
69+
go install ./cmd/llcppgtest
70+
echo "PATH=$GITHUB_WORKSPACE/build/${{matrix.platform}}-${{matrix.arch}}:$PATH" >> $GITHUB_ENV
71+
72+
- name: Test llcppg binaries with demo test
73+
if: startsWith(matrix.os, 'macos')
74+
run: bash .github/workflows/test_macos.sh
75+
76+
- name: Test llcppg binaries with demo test
77+
if: startsWith(matrix.os, 'ubuntu')
78+
run: bash .github/workflows/test_linux.sh
79+
6580
- name: Upload binaries
6681
uses: actions/upload-artifact@v4
6782
with:

.github/workflows/test_linux.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sudo apt install liblua5.4-dev libsqlite3-dev libgmp-dev libgpg-error-dev zlib1g-dev libisl-dev libz3-dev -y
2+
llcppgtest -demo ./_llcppgtest/cjson -conf conf/linux
3+
llcppgtest -demo ./_llcppgtest/gmp -conf conf/linux
4+
llcppgtest -demo ./_llcppgtest/gpgerror -conf conf/linux
5+
llcppgtest -demo ./_llcppgtest/isl
6+
llcppgtest -demo ./_llcppgtest/lua -conf conf/linux
7+
llcppgtest -demo ./_llcppgtest/sqlite -conf conf/linux
8+
llcppgtest -demo ./_llcppgtest/z3 -conf conf/linux
9+
llcppgtest -demo ./_llcppgtest/zlib -conf conf/linux

.github/workflows/test_macos.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# install demo's lib
2+
brew install lua zlib isl libgpg-error raylib z3 sqlite3 gmp libxml2 libxslt
3+
4+
export PKG_CONFIG_PATH="/opt/homebrew/opt/zlib/lib/pkgconfig"
5+
export PKG_CONFIG_PATH="/opt/homebrew/opt/sqlite/lib/pkgconfig:$PKG_CONFIG_PATH"
6+
export PKG_CONFIG_PATH="/opt/homebrew/opt/libxml2/lib/pkgconfig:$PKG_CONFIG_PATH"
7+
export PKG_CONFIG_PATH="/opt/homebrew/opt/libxslt/lib/pkgconfig:$PKG_CONFIG_PATH"
8+
pkg-config --cflags --libs sqlite3
9+
pkg-config --cflags --libs libxslt
10+
11+
llcppgtest -demos ./_llcppgtest

0 commit comments

Comments
 (0)