-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (88 loc) · 2.67 KB
/
test-bindings.yml
File metadata and controls
104 lines (88 loc) · 2.67 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Test Multi-Language Bindings
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test-bindings:
name: Test Bindings (${{ matrix.language }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- language: zig
os: ubuntu-latest
- language: rust
os: ubuntu-latest
- language: cpp
os: ubuntu-latest
- language: go
os: ubuntu-latest
- language: python
os: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Zig
uses: mlugg/setup-zig@v2
with:
version: 0.15.2
- name: Build shared library
run: zig build shared
- name: Set library environment
run: |
echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/zig-out/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "GOLDENFLOAT_LIB_DIR=$GITHUB_WORKSPACE/zig-out/lib" >> $GITHUB_ENV
- name: Test Zig
if: matrix.language == 'zig'
run: zig build test
- name: Install Rust
if: matrix.language == 'rust'
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Test Rust
if: matrix.language == 'rust'
run: |
cd rust/goldenfloat-sys
cargo test --verbose
- name: Install Python
if: matrix.language == 'python'
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Test Python
if: matrix.language == 'python'
run: |
cd python
pip install -e . -q
python -m goldenfloat.tests.test_gf16
env:
GOLDENFLOAT_LIB_DIR: ${{ github.workspace }}/zig-out/lib
- name: Install CMake
if: matrix.language == 'cpp'
uses: jwlawson/actions-setup-cmake@v2
- name: Install nlohmann/json
if: matrix.language == 'cpp'
run: sudo apt-get install -y nlohmann-json3-dev
- name: Test C++
if: matrix.language == 'cpp'
run: |
cd cpp
mkdir -p build
cmake -S . -B build -DGOLDENFLOAT_LIB_DIR=$GITHUB_WORKSPACE/zig-out/lib
cmake --build build --target test_gf16
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/zig-out/lib ./build/test_gf16
- name: Install Go
if: matrix.language == 'go'
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Test Go
if: matrix.language == 'go'
run: |
cd go/goldenfloat
go test -v ./...
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/zig-out/lib