Skip to content

Commit f955042

Browse files
committed
add ctest, ci template, find template
1 parent 0c513eb commit f955042

File tree

9 files changed

+220
-171
lines changed

9 files changed

+220
-171
lines changed

.github/workflows/ci_linux.yml

Lines changed: 5 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -7,75 +7,21 @@ on:
77
- "**.F90"
88
- "**.cmake"
99
- "**.txt"
10-
- "**.build"
1110
- ".github/workflows/ci_linux.yml"
1211
pull_request:
13-
release:
1412

1513
jobs:
1614

17-
linuxCMake:
15+
linux:
1816
runs-on: ubuntu-latest
1917
steps:
2018
- uses: actions/checkout@v2
2119
- uses: actions/setup-python@v1
2220
with:
2321
python-version: '3.x'
2422

25-
- name: install prereqs
26-
run: |
27-
pip install cmake
28-
sudo apt update -yq
29-
sudo apt install -yq --no-install-recommends gfortran g++
30-
31-
- run: cmake -B build
32-
env:
33-
FC: gfortran
34-
CC: gcc
35-
CXX: g++
36-
- run: cmake --build build --parallel
37-
- uses: actions/upload-artifact@v1
38-
if: failure()
39-
with:
40-
name: Linux_Cmake_Buildlog
41-
path: build/CMakeFiles/CMakeError.log
42-
43-
- run: ctest -V
44-
working-directory: build
45-
- uses: actions/upload-artifact@v1
46-
if: failure()
47-
with:
48-
name: Linux_CMake_Testlog
49-
path: build/Testing/Temporary/LastTest.log
50-
51-
linuxMeson:
52-
runs-on: ubuntu-latest
53-
steps:
54-
- uses: actions/checkout@v2
55-
- uses: actions/setup-python@v1
56-
with:
57-
python-version: '3.x'
58-
59-
- run: pip install meson
60-
61-
- name: Install packages
62-
run: |
63-
sudo apt update -yq
64-
sudo apt install -yq --no-install-recommends ninja-build gfortran g++
65-
66-
- run: meson setup build
23+
- run: ctest -S setup.cmake -VV
6724
env:
68-
FC: gfortran
69-
- run: ninja -C build
70-
- uses: actions/upload-artifact@v1
71-
if: failure()
72-
with:
73-
name: Linux_Meson_Configlog
74-
path: build/meson-logs/meson-log.txt
75-
76-
- run: meson test -C build -v
77-
- uses: actions/upload-artifact@v1
78-
if: failure()
79-
with:
80-
name: Linux_Meson_Testlog
81-
path: build/meson-logs/testlog.txt
25+
FC: gfortran-9
26+
CC: gcc-9
27+
CXX: g++-9
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: ci_linux_meson
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.f90"
7+
- "**.F90"
8+
- "**.build"
9+
- ".github/workflows/ci_linux_meson.yml"
10+
pull_request:
11+
12+
jobs:
13+
14+
linux:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
22+
- run: pip install meson==0.53.2 ninja
23+
24+
- run: meson setup build
25+
env:
26+
FC: gfortran-9
27+
CC: gcc-9
28+
CXX: g++-9
29+
30+
- run: ninja -C build
31+
- uses: actions/upload-artifact@v1
32+
if: failure()
33+
with:
34+
name: Linux_Meson_Configlog
35+
path: build/meson-logs/meson-log.txt
36+
37+
- run: meson test -C build -v
38+
- uses: actions/upload-artifact@v1
39+
if: failure()
40+
with:
41+
name: Linux_Meson_Testlog
42+
path: build/meson-logs/testlog.txt

.github/workflows/ci_macos.yml

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -7,64 +7,19 @@ on:
77
- "**.F90"
88
- "**.cmake"
99
- "**.txt"
10-
- "**.build"
1110
- ".github/workflows/ci_macos.yml"
1211
pull_request:
1312
release:
1413

1514
jobs:
1615

17-
macosCMake:
16+
macos:
1817
runs-on: macos-latest
1918
steps:
2019
- uses: actions/checkout@v2
21-
- run: brew install gcc
2220

23-
- run: cmake -B build
21+
- run: ctest -S setup.cmake -VV
2422
env:
2523
FC: gfortran-9
2624
CC: gcc-9
2725
CXX: g++-9
28-
- run: cmake --build build --parallel
29-
- uses: actions/upload-artifact@v1
30-
if: failure()
31-
with:
32-
name: MacOS_Cmake_Buildlog
33-
path: build/CMakeFiles/CMakeError.log
34-
35-
- run: ctest -V
36-
working-directory: build
37-
- uses: actions/upload-artifact@v1
38-
if: failure()
39-
with:
40-
name: Mac_CMake_Testlog
41-
path: build/Testing/Temporary/LastTest.log
42-
43-
macosMeson:
44-
runs-on: macos-latest
45-
steps:
46-
- uses: actions/checkout@v2
47-
- uses: actions/setup-python@v1
48-
with:
49-
python-version: '3.x'
50-
51-
- run: pip install meson
52-
53-
- run: brew install gcc ninja
54-
- run: meson setup build
55-
env:
56-
FC: gfortran
57-
- run: ninja -C build
58-
- uses: actions/upload-artifact@v1
59-
if: failure()
60-
with:
61-
name: Mac_Meson_Configlog
62-
path: build/meson-logs/meson-log.txt
63-
64-
65-
- run: meson test -C build -v
66-
- uses: actions/upload-artifact@v1
67-
if: failure()
68-
with:
69-
name: MacOS_Meson_Testlog
70-
path: build/meson-logs/testlog.txt
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: ci_macos_meson
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.f90"
7+
- "**.F90"
8+
- "**.build"
9+
- ".github/workflows/ci_macos_meson.yml"
10+
pull_request:
11+
12+
jobs:
13+
14+
macos:
15+
runs-on: macos-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
22+
- run: pip install meson==0.53.2 ninja
23+
24+
- run: meson setup build
25+
26+
- run: ninja -C build
27+
- uses: actions/upload-artifact@v1
28+
if: failure()
29+
with:
30+
name: Mac_Meson_Configlog
31+
path: build/meson-logs/meson-log.txt
32+
33+
34+
- run: meson test -C build -v
35+
- uses: actions/upload-artifact@v1
36+
if: failure()
37+
with:
38+
name: MacOS_Meson_Testlog
39+
path: build/meson-logs/testlog.txt

.github/workflows/ci_windows.yml

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,70 +7,23 @@ on:
77
- "**.F90"
88
- "**.cmake"
99
- "**.txt"
10-
- "**.build"
1110
- ".github/workflows/ci_windows.yml"
1211
pull_request:
13-
release:
1412

1513
jobs:
1614

17-
windowsCmake:
15+
windows:
1816
runs-on: windows-latest
1917
steps:
2018
- uses: actions/checkout@v2
2119
- uses: actions/setup-python@v1
2220
with:
2321
python-version: '3.x'
2422

25-
- run: |
26-
pip install meson
27-
cinst -y ninja
23+
- run: cinst -y ninja
2824

29-
- run: cmake -B build -G Ninja -DCMAKE_SH="CMAKE_SH-NOTFOUND"
25+
- run: ctest -S setup.cmake -VV
3026
env:
3127
FC: gfortran
3228
CC: gcc
3329
CXX: g++
34-
- run: cmake --build build --parallel
35-
- uses: actions/upload-artifact@v1
36-
if: failure()
37-
with:
38-
name: Windows_Cmake_Buildlog
39-
path: build/CMakeFiles/CMakeError.log
40-
41-
- run: ctest -V
42-
working-directory: build
43-
- uses: actions/upload-artifact@v1
44-
if: failure()
45-
with:
46-
name: Windows_CMake_Testlog
47-
path: build/Testing/Temporary/LastTest.log
48-
49-
windowsMeson:
50-
runs-on: windows-latest
51-
steps:
52-
- uses: actions/checkout@v2
53-
- uses: actions/setup-python@v1
54-
with:
55-
python-version: '3.x'
56-
57-
- run: |
58-
pip install meson
59-
cinst -y ninja
60-
61-
- run: meson setup build
62-
env:
63-
FC: gfortran
64-
- run: ninja -C build
65-
- uses: actions/upload-artifact@v1
66-
if: failure()
67-
with:
68-
name: Windows_Meson_Configlog
69-
path: build/meson-logs/meson-log.txt
70-
71-
- run: meson test -C build -v
72-
- uses: actions/upload-artifact@v1
73-
if: failure()
74-
with:
75-
name: Windows_Meson_Testlog
76-
path: build/meson-logs/testlog.txt
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ci_windows_meson
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.f90"
7+
- "**.F90"
8+
- "**.build"
9+
- ".github/workflows/ci_windows_meson.yml"
10+
pull_request:
11+
12+
jobs:
13+
14+
windows:
15+
runs-on: windows-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-python@v1
19+
with:
20+
python-version: '3.x'
21+
22+
- run: |
23+
pip install meson==0.53.2
24+
cinst -y ninja
25+
26+
- run: meson setup build
27+
28+
- run: ninja -C build
29+
- uses: actions/upload-artifact@v1
30+
if: failure()
31+
with:
32+
name: Windows_Meson_Configlog
33+
path: build/meson-logs/meson-log.txt
34+
35+
- run: meson test -C build -v
36+
- uses: actions/upload-artifact@v1
37+
if: failure()
38+
with:
39+
name: Windows_Meson_Testlog
40+
path: build/meson-logs/testlog.txt

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Fortran 2018 Examples
22

3-
[![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_linux/badge.svg)](https://github.com/scivision/fortran2018-examples/actions)
4-
[![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_windows/badge.svg)](https://github.com/scivision/fortran2018-examples/actions)
5-
[![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_macos/badge.svg)](https://github.com/scivision/fortran2018-examples/actions)
3+
![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_linux/badge.svg)
4+
![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_windows/badge.svg)
5+
![Actions Status](https://github.com/scivision/fortran2018-examples/workflows/ci_macos/badge.svg)
66

77
Easy examples of scientific computing with modern, powerful, easy Fortran 2018 standard.
88
Fortran 2018 began as the TS18508 extension, formerly known as Fortran 2015.
@@ -27,6 +27,14 @@ The CMake or Meson build system automatically walks through the subdirectories:
2727

2828
### CMake
2929

30+
One step CMake build and test:
31+
32+
```sh
33+
ctest -S setup.cmake -VV
34+
```
35+
36+
OR more manually:
37+
3038
```sh
3139
cmake -B build
3240
cmake --build build --parallel

0 commit comments

Comments
 (0)