-
Notifications
You must be signed in to change notification settings - Fork 191
65 lines (62 loc) · 1.98 KB
/
test-c-example.yml
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
# This tests the C example, and it uses a similar build script to the one used
# by JuMP when building HiGHS:
# https://github.com/JuliaPackaging/Yggdrasil/blob/master/H/HiGHS/build_tarballs.jl
name: test-c-example
on: [push, pull_request]
jobs:
fast-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Build Environment
run: |
mkdir build
mkdir installs
- name: Build HiGHS library
shell: bash
working-directory: build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX=../installs/highs \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DFAST_BUILD=ON \
$GITHUB_WORKSPACE
cmake --build . --config Release --parallel
make install
- name: Compile and test C example
shell: bash
run: |
gcc $GITHUB_WORKSPACE/examples/call_highs_from_c.c \
-o c_example \
-I installs/highs/include/highs \
-L installs/highs/lib -lhighs
LD_LIBRARY_PATH=installs/highs/lib ./c_example
fast-build-off:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Build Environment
run: |
mkdir build
mkdir installs
- name: Build HiGHS library
shell: bash
working-directory: build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX=../installs/highs \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DFAST_BUILD=OFF \
$GITHUB_WORKSPACE
cmake --build . --config Release --parallel
make install
- name: Compile and test C example
shell: bash
run: |
gcc $GITHUB_WORKSPACE/examples/call_highs_from_c.c \
-o c_example \
-I installs/highs/include/highs \
-L installs/highs/lib -lhighs
LD_LIBRARY_PATH=installs/highs/lib ./c_example