Skip to content

Commit fb7622e

Browse files
committed
fix CI
1 parent b5e31cd commit fb7622e

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/ci.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
10+
jobs:
11+
test-python:
12+
name: Test Python API
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.11'
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install build
26+
27+
- name: Build Python package
28+
run: |
29+
cd python-api
30+
python -m build
31+
32+
test-nodejs:
33+
name: Test Node.js API
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Set up Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: '20'
42+
43+
- name: Install dependencies
44+
run: |
45+
cd nodejs-api
46+
npm ci
47+
48+
- name: Build
49+
run: |
50+
cd nodejs-api
51+
npm run build
52+
53+
build-rust-cli:
54+
name: Build Rust CLI - ${{ matrix.target }}
55+
runs-on: ${{ matrix.os }}
56+
strategy:
57+
matrix:
58+
include:
59+
- os: ubuntu-latest
60+
target: x86_64-unknown-linux-gnu
61+
- os: ubuntu-latest
62+
target: aarch64-unknown-linux-gnu
63+
- os: macos-latest
64+
target: x86_64-apple-darwin
65+
- os: macos-latest
66+
target: aarch64-apple-darwin
67+
- os: windows-latest
68+
target: x86_64-pc-windows-msvc
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Set up Rust
74+
uses: dtolnay/rust-toolchain@stable
75+
with:
76+
targets: ${{ matrix.target }}
77+
78+
- name: Install cross-compilation tools (Linux ARM)
79+
if: matrix.target == 'aarch64-unknown-linux-gnu'
80+
run: |
81+
sudo apt-get update
82+
sudo apt-get install -y gcc-aarch64-linux-gnu
83+
84+
- name: Configure cross-compilation (Linux ARM)
85+
if: matrix.target == 'aarch64-unknown-linux-gnu'
86+
run: |
87+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
88+
89+
- name: Build
90+
run: |
91+
cd rust-cli
92+
cargo build --release --target ${{ matrix.target }}
93+
94+
- name: Test (native builds only)
95+
if: |
96+
(matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64-unknown-linux-gnu') ||
97+
(matrix.os == 'macos-latest' && matrix.target == 'x86_64-apple-darwin') ||
98+
(matrix.os == 'windows-latest' && matrix.target == 'x86_64-pc-windows-msvc')
99+
run: |
100+
cd rust-cli
101+
cargo test --release --target ${{ matrix.target }}

0 commit comments

Comments
 (0)