Skip to content

Commit 2c6e173

Browse files
committed
Split off workflow for inline CMake build and manual Makefile build
1 parent 2c4c9a4 commit 2c6e173

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

.github/workflows/CI.yml

+20-14
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ jobs:
2121
matrix:
2222
os: [ubuntu-latest, macos-latest]
2323
gcc_v: [9, 10, 11] # Version of GFortran we want to use.
24+
build: [cmake]
25+
include:
26+
- os: ubuntu-latest
27+
gcc_v: 10
28+
build: cmake-inline
29+
- os: ubuntu-latest
30+
gcc_v: 10
31+
build: make
2432
env:
2533
FC: gfortran-${{ matrix.gcc_v }}
2634
GCC_V: ${{ matrix.gcc_v }}
35+
BUILD_DIR: ${{ matrix.build == "cmake" && "build" || "." }}
2736

2837
steps:
2938
- name: Checkout code
@@ -58,35 +67,32 @@ jobs:
5867
brew link gcc@${GCC_V}
5968
6069
- name: Configure with CMake
70+
if: ${{ contains(matrix.build, 'cmake') }}
6171
run: >-
6272
cmake -Wdev
6373
-DCMAKE_BUILD_TYPE=Release
6474
-DCMAKE_MAXIMUM_RANK:String=4
6575
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
66-
-S . -B build
76+
-S . -B ${{ env.BUILD_DIR }}
6777
6878
- name: Build and compile
69-
run: cmake --build build --parallel
79+
if: ${{ contains(matrix.build, 'cmake') }}
80+
run: cmake --build ${{ env.BUILD_DIR }} --parallel
7081

7182
- name: catch build fail
72-
run: cmake --build build --verbose --parallel 1
73-
if: failure()
83+
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
84+
if: ${{ failure() && contains(matrix.build, 'cmake') }}
7485

7586
- name: test
76-
run: ctest --test-dir build --parallel --output-on-failure
87+
if: ${{ contains(matrix.build, 'cmake') }}
88+
run: ctest --test-dir ${{ env.BUILD_DIR }} --parallel --output-on-failure
7789

7890
- name: Install project
79-
run: cmake --install build
80-
81-
- name: Test in-tree builds
82-
if: contains( matrix.gcc_v, '10') # Only test one compiler on each platform
83-
run: |
84-
cmake -DCMAKE_MAXIMUM_RANK=4 .
85-
cmake --build .
86-
cmake --build . --target test
91+
if: ${{ contains(matrix.build, 'cmake') }}
92+
run: cmake --install ${{ env.BUILD_DIR }}
8793

8894
- name: Test manual makefiles
89-
if: contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '10')
95+
if: ${{ matrix.build == 'make' }}
9096
run: |
9197
make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4" -j
9298
make -f Makefile.manual test

0 commit comments

Comments
 (0)