Skip to content

Commit 4da9ec7

Browse files
committed
ci template
1 parent 859d62b commit 4da9ec7

File tree

1 file changed

+34
-17
lines changed

1 file changed

+34
-17
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515

1616
linux:
1717
runs-on: ubuntu-20.04
18+
timeout-minutes: 15
19+
env:
20+
CTEST_SITE: GitHub_Ubuntu
21+
1822
steps:
1923
- uses: actions/checkout@v2
2024

@@ -23,30 +27,35 @@ jobs:
2327
sudo apt update -yq
2428
sudo apt install -yq --no-install-recommends ninja-build gfortran libnetcdff-dev
2529
26-
- run: cmake --preset=ninja -DCMAKE_INSTALL_PREFIX=~/hdf5
27-
- run: cmake --build build
28-
- run: cmake --install build
29-
- run: ctest --parallel 2 --output-on-failure
30-
working-directory: build
30+
- name: CDash
31+
run: ctest -S ci.cmake -V
32+
33+
- name: Install package
34+
run: |
35+
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=~/nc4fortran
36+
cmake --install build
3137
3238
- name: configure examples
33-
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=~/hdf5
34-
- name: build exmaples
39+
run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT:PATH=~/nc4fortran
40+
- name: build examples
3541
run: cmake --build Examples/build --parallel
3642
- name: Test examples
3743
run: ctest --parallel 2 --output-on-failure
3844
working-directory: Examples/build
3945

4046
- name: create package
47+
if: github.event.action == 'published'
4148
run: cpack --config build/CPackConfig.cmake
4249

4350
- name: Upload artifact
51+
if: github.event.action == 'published'
4452
uses: actions/upload-artifact@v1
4553
with:
4654
name: binary-archive
4755
path: build/package
4856

4957
- name: get version
58+
if: github.event.action == 'published'
5059
id: get_version
5160
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
5261

@@ -63,14 +72,16 @@ jobs:
6372

6473

6574
linuxCmake313:
66-
runs-on: ubuntu-20.04
75+
runs-on: ubuntu-latest
76+
timeout-minutes: 15
77+
6778
steps:
6879
- uses: actions/checkout@v2
6980

7081
- name: install netcdf4
7182
run: |
7283
sudo apt update -yq
73-
sudo apt install -yq --no-install-recommends ninja-build gfortran libnetcdff-dev
84+
sudo apt install -yq --no-install-recommends gfortran libnetcdff-dev
7485
7586
- name: get CMake 3.13
7687
run: |
@@ -85,39 +96,45 @@ jobs:
8596

8697

8798
mac:
88-
needs: linux
8999
runs-on: macos-latest
100+
timeout-minutes: 20
90101
env:
91102
HOMEBREW_NO_INSTALL_CLEANUP: 1
92-
FC: gfortran-10
93103
CC: gcc-10
104+
FC: gfortran-10
105+
CTEST_SITE: GitHub_MacOS
94106

95107
steps:
96108
- uses: actions/checkout@v2
97109

98110
- run: brew install netcdf ninja
99111

100-
- run: cmake --preset=ninja -DCMAKE_INSTALL_PREFIX=~/hdf5
101-
- run: cmake --build build
102-
- run: cmake --install build
103-
- run: ctest --parallel 2 --output-on-failure
104-
working-directory: build
112+
- name: CDash
113+
run: ctest -S ci.cmake -V
105114

106-
- run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT=~/hdf5
115+
- name: Install package
116+
run: |
117+
cmake -B build -DCMAKE_INSTALL_PREFIX:PATH=~/nc4fortran
118+
cmake --install build
119+
120+
- run: cmake -S Examples -B Examples/build -Dnc4fortran_ROOT:PATH=~/h5fortran
107121
- run: cmake --build Examples/build --parallel
108122
- run: ctest --parallel 2 --output-on-failure
109123
working-directory: Examples/build
110124

111125
- name: create package
126+
if: github.event.action == 'published'
112127
run: cpack --config build/CPackConfig.cmake
113128

114129
- name: Upload artifact
130+
if: github.event.action == 'published'
115131
uses: actions/upload-artifact@v1
116132
with:
117133
name: binary-archive
118134
path: build/package
119135

120136
- name: get version
137+
if: github.event.action == 'published'
121138
id: get_version
122139
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
123140

0 commit comments

Comments
 (0)