-
Notifications
You must be signed in to change notification settings - Fork 7
69 lines (60 loc) · 2.13 KB
/
build_and_run_tests.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
# Test changes that have been pushed to the master branch
name: Testing and Validation
# Controls when the action will run.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
#env:
# Obtained from https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
# TODO: add something later that can check the runners for hyperthreading
#LINUX_NUM_PROC_CORES: 2
#MACOS_NUM_PROC_CORES: 3
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Run general unit tests in linux environment
test_unit:
# The type of runner that the job will run on
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout the commit
uses: actions/checkout@v4
# - name: check gcc version
# run: gcc --version
- name: Build and Run Unittest
run: |
cd tests
if [ ${{ runner.os }} == 'macOS' ]
then
brew install gnu-sed
#PATH="$(brew --prefix)/opt/gnu-sed/libexec/gnubin:$PATH"
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
fi
sed -i 's/\${CXX}/g++/' run_unittest.sh
./run_unittest.sh
- name: Build and Run Standalone
run: |
mkdir build && cd build
cmake ../ -DSTANDALONE=ON
make && cd ..
./run_sft.sh STANDALONE
- name: Build and Run Pseudo Framework Mode
run: |
git clone https://github.com/NOAA-OWP/cfe extern/cfe
git clone https://github.com/NOAA-OWP/SoilMoistureProfiles extern/SoilMoistureProfiles
git clone https://github.com/NOAA-OWP/aorc_bmi extern/aorc_bmi
git clone https://github.com/NOAA-OWP/evapotranspiration extern/evapotranspiration
if [ -d build ]; then
rm -rf build
fi
mkdir build && cd build
cmake ../ -DPFRAMEWORK=ON
make && cd ..
./run_sft.sh PFRAMEWORK