Skip to content

Commit f1e9f2b

Browse files
authored
Add GitHub Action configuration to build on Windows, OSX, and Ubuntu (#49)
* Add build GitHub action to test compilation * need zlib * add install step * fix our test :) * turn off caching for now
1 parent 018f6d6 commit f1e9f2b

2 files changed

Lines changed: 85 additions & 0 deletions

File tree

.github/environment.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: build
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- conda
6+
- compilers
7+
- ninja
8+
- cmake
9+
- zlib
10+

.github/workflows/test.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
name: Test
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
name: ${{ matrix.os }} with BUILD_SHARED_LIBS=${{matrix.shared}}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [macos-latest, windows-latest, ubuntu-latest]
16+
shared: [ON, OFF]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: ilammy/msvc-dev-cmd@v1
21+
if: matrix.os == 'windows-latest'
22+
- name: Support longpaths
23+
run: git config --system core.longpaths true
24+
if: matrix.os == 'windows-latest'
25+
- uses: mamba-org/setup-micromamba@v2
26+
with:
27+
init-shell: bash
28+
environment-file: .github/environment.yml
29+
environment-name: "build"
30+
31+
- name: Setup
32+
shell: bash -l {0}
33+
run: |
34+
mkdir build
35+
36+
- name: CMake
37+
shell: bash -l {0}
38+
env:
39+
BUILD_SHARED_LIBS: ${{ matrix.shared }}
40+
41+
run: |
42+
43+
if [ "$RUNNER_OS" == "Windows" ]; then
44+
export CC=cl.exe
45+
export CXX=cl.exe
46+
fi
47+
48+
cmake -G "Ninja" \
49+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
50+
-DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \
51+
-DBUILD_TESTING=ON \
52+
-DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} \
53+
..
54+
55+
56+
working-directory: ./build
57+
58+
- name: Compile
59+
shell: bash -l {0}
60+
run: |
61+
ninja
62+
working-directory: ./build
63+
64+
- name: Install
65+
shell: bash -l {0}
66+
run: |
67+
ninja install
68+
working-directory: ./build
69+
70+
- name: "There are no tests :spoon:"
71+
shell: bash -l {0}
72+
run: |
73+
echo "There are no tests"
74+
working-directory: ./build
75+

0 commit comments

Comments
 (0)