-
Notifications
You must be signed in to change notification settings - Fork 3
78 lines (64 loc) · 2.39 KB
/
test.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
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build and Test
on: [push, pull_request]
jobs:
build-and-test:
# We want to run on external PRs, but not on our own internal PRs as they'll be run
# by the push to the branch. Without this if check, checks are duplicated since
# internal PRs match both the push and pull_request events.
if:
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
github.repository
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
build-type: [Release]
steps:
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: latest
environment-name: testing
init-shell: >-
bash
powershell
create-args: >-
make
cmake
cxx-compiler
pkg-config
- name: Make CMake build directory
run: cmake -E make_directory build
- name: Configure cmake (Unix)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
working-directory: ${{ github.workspace }}/build
run: |
cmake .. \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
- name: Configure CMake (windows)
if: matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}\build
shell: pwsh
run: |
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" x86
cmake .. `
-DCMAKE_INSTALL_PREFIX:PATH=$env:CONDA_PREFIX\Library `
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }}
- name: Build
working-directory: ${{ github.workspace }}/build
run: cmake --build . --target install --config ${{ matrix.build-type }}
- name: Test (Unix)
if: matrix.os != 'windows-latest'
run: |
test -f $CONDA_PREFIX/include/bmi.hxx
test -f $CONDA_PREFIX/lib/pkgconfig/bmicxx.pc
- name: Test (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
if ( -not ( Test-Path -Path $env:CONDA_PREFIX\Library\include\bmi.hxx ) ){ exit 1 }
if ( -not ( Test-Path -Path $env:CONDA_PREFIX\Library\lib\pkgconfig\bmicxx.pc ) ){ exit 1 }