Skip to content

Commit ae659ec

Browse files
authored
Merge pull request #36 from JohanMabille/ci
Added workflows for GHA
2 parents 1a6247d + 472c60c commit ae659ec

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

.github/workflows/main.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: CI
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
defaults:
12+
run:
13+
shell: bash -l {0}
14+
15+
jobs:
16+
unix:
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-20.04, ubuntu-22.04, macos-13, macos-14]
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Get number of CPU cores
29+
uses: SimenB/github-actions-cpu-cores@v2
30+
31+
- name: Install mamba
32+
uses: mamba-org/setup-micromamba@v1
33+
with:
34+
environment-file: environment-dev.yml
35+
36+
- name: Make build directory
37+
run: mkdir build
38+
39+
- name: Configure CMake
40+
run: |
41+
cmake .. \
42+
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX \
43+
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
44+
-DDOWNLOAD_GTEST=ON \
45+
-DCMAKE_INSTALL_LIBDIR=lib
46+
working-directory: build
47+
48+
- name: Build
49+
run: make -j ${{ steps.cpu-cores.outputs.count }}
50+
working-directory: build
51+
52+
- name: Test xeus-calc
53+
run: ./test_xeus_calc
54+
working-directory: build/test
55+
56+
win:
57+
58+
runs-on: ${{ matrix.os }}
59+
defaults:
60+
run:
61+
shell: cmd /C call {0}
62+
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [ windows-2019, windows-2022 ]
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Install mamba
72+
uses: mamba-org/setup-micromamba@v1
73+
with:
74+
environment-file: environment-dev.yml
75+
init-shell: cmd.exe
76+
77+
- name: Make build directory
78+
run: mkdir build
79+
80+
- name: Configure cmake
81+
run: |
82+
cmake .. ^
83+
-G Ninja ^
84+
-DCMAKE_BUILD_TYPE=Release ^
85+
-DDOWNLOAD_GTEST=ON ^
86+
-DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" ^
87+
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library" ^
88+
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%"
89+
working-directory: build
90+
91+
- name: Build
92+
run: |
93+
set CL=/MP
94+
ninja install
95+
working-directory: build

0 commit comments

Comments
 (0)