pseudo_framework_cfe #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Test changes that have been pushed to the master branch | |
name: Testing and Validation | |
# Controls when the action will run. | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
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 | |
export PATH="$(brew --prefix gsed)/libexec/gnubin:$PATH" | |
fi | |
sed -i 's/\${CXX}/g++/' run_unittest.sh | |
./run_unittest.sh | |
- name: Build and Run CFE | |
run: | | |
git clone https://github.com/NOAA-OWP/cfe extern/cfe | |
if [ -d build ]; then | |
rm -rf build | |
fi | |
mkdir build && cd build | |
cmake ../ -DCFE=ON | |
make && cd .. | |
./run_smp.sh CFE | |
- name: Build and Run with Topmodel | |
run: | | |
git clone https://github.com/NOAA-OWP/topmodel extern/topmodel | |
if [ -d build ]; then | |
rm -rf build | |
fi | |
mkdir build && cd build | |
cmake ../ -DTOPMODEL=ON | |
make && cd .. | |
./run_smp.sh TOPMODEL |