-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (70 loc) · 2.46 KB
/
main_nix.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: tests
#TODO: run unit tests with different compiler versions of both gcc and clang
on:
push:
branches: [master, main, release/**]
pull_request:
branches: [master, main, release/**]
jobs:
build_nix:
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Print compiler versions as seen by make
run: make compiler_version
- name: Run binary
run: |
make clean bin_run
make clean bin_debug_severe
- name: Run binary (with sanitizers)
# Apple clang does not support "AddressSanitizer: detect_leaks" (at least as of clang-1200.0.32.29)
if: ${{ runner.os != 'macOS' }}
run: make clean bin_sanitizer
- name: Unit tests (shuffle and repeat 3x)
run: make clean test_rep3rnd
- name: Severe unit tests (without sanitizers)
if: ${{ runner.os == 'macOS' }}
run: make clean test_severe
- name: Severe unit tests (with sanitizers)
# Apple clang does not support "AddressSanitizer: detect_leaks" (at least as of clang-1200.0.32.29)
if: ${{ runner.os != 'macOS' }}
run: make clean test_sanitizer
- name: Compile as library for STEPWAT2
run: CPPFLAGS='-DSTEPWAT' make clean lib
- name: Compile as library for rSOILWAT2
# Rmock/ provides bare-bones headers of R C-API functions required by SOILWAT2
run: CPPFLAGS='-DRSOILWAT' CFLAGS='-Iexternal/Rmock' make clean libr
build_ncSW2:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install netCDF-C and udunits2
run: |
sudo apt-get update
sudo apt-get install libnetcdf-dev libudunits2-dev
- name: Build binary with netCDF and udunits2 support
run: CPPFLAGS=-DSWNC make clean all
check_code_coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Generate coverage report
run: CXX=g++ GCOV=gcov make clean clean_cov cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false # just report, don't fail checks
token: ${{ secrets.CODECOV_TOKEN }}