@@ -2,11 +2,13 @@ name: Build/Test
2
2
3
3
on : [push, pull_request]
4
4
5
+ env :
6
+ BUILD_DIR : _build
7
+
5
8
jobs :
6
9
build-test-unix :
7
10
if :
8
- github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
9
- github.repository
11
+ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
10
12
11
13
runs-on : ${{ matrix.os }}
12
14
25
27
steps :
26
28
- uses : actions/checkout@v4
27
29
28
- - uses : mamba-org/setup-micromamba@v1
30
+ - uses : mamba-org/setup-micromamba@v2
29
31
with :
30
32
micromamba-version : latest
31
33
environment-name : testing
@@ -35,19 +37,14 @@ jobs:
35
37
fortran-compiler
36
38
bmi-fortran
37
39
38
- - name : Make CMake build directory
39
- run : cmake -E make_directory build
40
-
41
- - name : Configure CMake
42
- working-directory : ${{ github.workspace }}/build
40
+ - name : Configure project
43
41
run : |
44
- cmake $GITHUB_WORKSPACE \
42
+ cmake $GITHUB_WORKSPACE -B ${{ env.BUILD_DIR }} \
45
43
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
46
44
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
47
45
48
- - name : Build
49
- working-directory : ${{ github.workspace }}/build
50
- run : cmake --build . --target install --config ${{ matrix.build-type }}
46
+ - name : Build and install project
47
+ run : cmake --build ${{ env.BUILD_DIR }} --target install --config ${{ matrix.build-type }}
51
48
52
49
- name : Test for installed files
53
50
run : |
58
55
test -f $CONDA_PREFIX/include/bmiheatf.mod
59
56
test -f $CONDA_PREFIX/lib/pkgconfig/bmiheatf.pc
60
57
61
- - name : Run CTest
62
- working-directory : ${{ github.workspace }}/build
63
- run : ctest -C ${{ matrix.build-type }} --output-on-failure
58
+ - name : Run project tests
59
+ run : ctest --test-dir ${{ env.BUILD_DIR }} -C ${{ matrix.build-type }} --output-on-failure
64
60
65
61
- name : Memcheck
66
62
if : matrix.os == 'ubuntu-latest'
78
74
79
75
build-test-windows :
80
76
if :
81
- github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
82
- github.repository
77
+ github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
83
78
84
79
runs-on : windows-latest
85
80
0 commit comments