Skip to content

Commit 56dc0fb

Browse files
authored
Merge pull request #1 from LagrangeDev/feat/vcpkg
Use vcpkg & add tests & fix minor bugs
2 parents a1aa17e + f1e79eb commit 56dc0fb

36 files changed

+2835
-173
lines changed

.github/workflows/build.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
name: Build LagrangeCodec
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- '*'
8+
9+
jobs:
10+
build-windows-x64:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Setup Toolchains
16+
uses: MinoruSekine/setup-scoop@v4.0.1
17+
with:
18+
apps: ninja
19+
20+
- uses: ilammy/msvc-dev-cmd@v1
21+
- name: Build LagrangeCodec
22+
run: |
23+
$env:VCPKG_ROOT = "C:\vcpkg"
24+
$env:PATH = "$env:VCPKG_ROOT;$env:PATH"
25+
cmake -DCMAKE_BUILD_TYPE=Release --preset msvc-x64-windows-static-release -S . -B build
26+
cd build && ninja && ls
27+
28+
- name: Run Tests
29+
run: |
30+
cd build && ctest -C Release -V --no-compress-output
31+
32+
- name: Upload Artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: LagrangeCodec.x64.dll
36+
path: build/LagrangeCodec.dll
37+
38+
build-windows-x86:
39+
runs-on: windows-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Toolchains
44+
uses: MinoruSekine/setup-scoop@v4.0.1
45+
with:
46+
apps: ninja
47+
48+
- uses: ilammy/msvc-dev-cmd@v1
49+
with:
50+
arch: x86
51+
52+
- name: Build LagrangeCodec
53+
run: |
54+
$env:VCPKG_ROOT = "C:\vcpkg"
55+
$env:PATH = "$env:VCPKG_ROOT;$env:PATH"
56+
cmake -DCMAKE_BUILD_TYPE=Release --preset msvc-x86-windows-static-release -S . -B build
57+
cmake --build build
58+
59+
- name: Run Tests
60+
run: |
61+
cd build && ctest -C Release -V --no-compress-output
62+
63+
- name: Upload Artifact
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: LagrangeCodec.x86.dll
67+
path: build/LagrangeCodec.dll
68+
69+
70+
build-linux-amd64:
71+
runs-on: ubuntu-22.04
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
76+
- name: Setup Toolchains
77+
run: |
78+
sudo apt-get update && sudo apt install build-essential cmake ninja-build nasm -y
79+
80+
- name: Build LagrangeCodec
81+
run: |
82+
export VCPKG_ROOT="/usr/local/share/vcpkg"
83+
export PATH="$VCPKG_ROOT:$PATH"
84+
cmake -DCMAKE_BUILD_TYPE=Release --preset gcc-x64-linux-static-release -S . -B build
85+
cmake --build build
86+
87+
- name: Run Tests
88+
run: |
89+
cd build && ctest -C Release -V --no-compress-output
90+
91+
- name: Upload Artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: libLagrangeCodec.x64.so
95+
path: build/libLagrangeCodec.so
96+
97+
build-linux-aarch64:
98+
runs-on: ubuntu-22.04-arm
99+
100+
steps:
101+
- uses: actions/checkout@v4
102+
103+
- name: Setup Toolchains
104+
run: |
105+
sudo apt-get update && sudo apt install build-essential cmake ninja-build nasm -y
106+
107+
- name: Build LagrangeCodec
108+
run: |
109+
export VCPKG_ROOT="/usr/local/share/vcpkg"
110+
export PATH="$VCPKG_ROOT:$PATH"
111+
cmake -DCMAKE_BUILD_TYPE=Release --preset gcc-arm64-linux-static-release -S . -B build
112+
cmake --build build
113+
114+
- name: Run Tests
115+
run: |
116+
cd build && ctest -C Release -V --no-compress-output
117+
118+
- name: Upload Artifact
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: libLagrangeCodec.arm64.so
122+
path: build/libLagrangeCodec.so
123+
124+
build-macos-amd64:
125+
runs-on: macos-latest
126+
127+
steps:
128+
- uses: actions/checkout@v4
129+
130+
- name: Setup Toolchains
131+
run: |
132+
softwareupdate --install-rosetta --agree-to-license
133+
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
134+
arch -x86_64 /usr/local/bin/brew install cmake make nasm ninja
135+
arch -x86_64 /usr/local/bin/brew link --overwrite make
136+
git clone https://github.com/microsoft/vcpkg.git
137+
cd vcpkg && arch -x86_64 /bin/bash ./bootstrap-vcpkg.sh
138+
139+
- name: Build LagrangeCodec
140+
run: |
141+
export VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg
142+
export PATH=$VCPKG_ROOT:$PATH
143+
arch -x86_64 /usr/local/bin/cmake --preset clang-x64-osx-static-release -S . -B build
144+
cd build && arch -x86_64 /usr/local/bin/ninja
145+
146+
- name: Run Tests
147+
run: |
148+
cd build && arch -x86_64 /usr/local/bin/ctest -C Release -V --no-compress-output
149+
150+
151+
- name: Upload Artifact
152+
uses: actions/upload-artifact@v4
153+
with:
154+
name: libLagrangeCodec.x64.dylib
155+
path: build/libLagrangeCodec.dylib
156+
157+
build-macos-aarch64:
158+
runs-on: macos-latest
159+
160+
steps:
161+
- uses: actions/checkout@v4
162+
163+
- name: Setup Toolchains
164+
run: |
165+
git clone https://github.com/microsoft/vcpkg.git
166+
cd vcpkg && ./bootstrap-vcpkg.sh
167+
brew install cmake ninja nasm
168+
169+
- name: Build LagrangeCodec
170+
run: |
171+
export VCPKG_ROOT=$GITHUB_WORKSPACE/vcpkg
172+
export PATH=$VCPKG_ROOT:$PATH
173+
cmake -DCMAKE_BUILD_TYPE=Release --preset clang-arm64-osx-static-release -S . -B build
174+
cmake --build build
175+
176+
- name: Run Tests
177+
run: |
178+
cd build && ctest -C Release -V --no-compress-output
179+
180+
- name: Upload Artifact
181+
uses: actions/upload-artifact@v4
182+
with:
183+
name: libLagrangeCodec.arm64.dylib
184+
path: build/libLagrangeCodec.dylib

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build-*
2+
/.idea
3+
/.vscode

0 commit comments

Comments
 (0)