Skip to content

Merge pull request #426 from NOAA-FIMS/update-issue-forms #1756

Merge pull request #426 from NOAA-FIMS/update-issue-forms

Merge pull request #426 from NOAA-FIMS/update-issue-forms #1756

Workflow file for this run

# Run C++ tests using GoogleTest
name: run-googletest
# on specifies the build triggers. See more info at https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
on:
workflow_dispatch:
# The default build trigger is to run the action on every push and pull request, for any branch
push:
# To run the default repository branch weekly on sunday, uncomment the following 2 lines
#schedule:
#- cron: '0 0 * * 0'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Use windows-2019 instead of windows-latest to avoid using Mingw-w64
os: [ubuntu-latest, macos-latest, windows-2019]
steps:
- uses: actions/checkout@v3
- name: Install Ninja
shell: bash
run: ${{ runner.os == 'macOS' && 'brew install ninja' || runner.os == 'Windows' && 'choco install ninja' || 'sudo apt-get install ninja-build' }}
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::remotes
- name: install local version of FIMS
run: remotes::install_local(upgrade = "always")
shell: Rscript {0}
- name: setup for gtest
run: FIMS:::setup_gtest()
shell: Rscript {0}
#note: the following configure, build and test steps could instead
# be run from r using FIMS::setup_and_run_gtest()
- name: Configure
# Do not run -DBUILD_DOC=OFF locally. Only run cmake -S . -B build -G Ninja locally.
run: |
cmake -S . -B build -DBUILD_DOC=OFF -G Ninja
- name: Build
run: |
cmake --build build --parallel 16
- name: Test
run: |
ctest --test-dir build --parallel 16
- name: Upload log when tests failed
uses: actions/upload-artifact@v3
if: failure()
with:
name: googletest-log-${{ matrix.os }}
path: |
build/Testing/Temporary/LastTest.log
build/CMakeFiles/CMakeOutput.log
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
- run: bash <(curl -s https://codecov.io/bash)
shell: bash