-
Notifications
You must be signed in to change notification settings - Fork 27
60 lines (58 loc) · 1.55 KB
/
build.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
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
base:
name: FGT ${{ matrix.platform }} with OpenMP ${{ matrix.openmp }}
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: true
matrix:
platform: ['ubuntu-latest', 'macos-14', 'windows-latest']
openmp: ['ON','OFF']
exclude:
- platform: 'macos-14'
openmp: 'ON'
- platform: 'windows-latest'
openmp: 'ON'
env:
PLATFORM: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
if: matrix.platform == 'windows-latest'
- uses: mamba-org/setup-micromamba@v1
with:
init-shell: bash
environment-file: scripts/${{ matrix.platform }}-environment.yml
environment-name: "fgt-build"
cache-downloads: true
- name: Create Build Directory
shell: bash -l {0}
run: |
mkdir build
- name: CMake
shell: bash -l {0}
env:
WITH_OPENMP: ${{ matrix.openmp }}
working-directory: ./build
run: |
source ./scripts/cmake/${{ matrix.platform }}-cmake.sh
- name: Build
shell: bash -l {0}
working-directory: ./build
run: ninja
- name: Paths
shell: bash -l {0}
if: matrix.openmp == 'ON'
run: echo "OMP_NUM_THREADS=4" >> $GITHUB_ENV
- name: Test
shell: bash -l {0}
working-directory: ./build
run: ctest