-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from peverwhee/sima-history
Initial commit for working SIMA history
- Loading branch information
Showing
13 changed files
with
1,245 additions
and
216 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: code-coverage | ||
|
||
on: | ||
push: | ||
branch: sima-history | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gcc: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout history | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build pFUnit | ||
run: | | ||
git clone --depth 1 --branch v4.10.0 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git | ||
cd pFUnit | ||
cmake -B./build -S. | ||
cd build | ||
make install | ||
- name: Build history | ||
run: | | ||
cmake \ | ||
-DCMAKE_PREFIX_PATH=/home/runner/work/history_output/history_output/pFUnit/build/installed \ | ||
-DHISTORY_ENABLE_CODE_COVERAGE=ON \ | ||
-B./build \ | ||
-S. | ||
cd build | ||
make | ||
- name: Run tests | ||
run: | | ||
cd build && ctest -V --output-on-failure --output-junit test_results.xml | ||
- name: Upload unit test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: unit-test-results | ||
path: build/test_results.xml | ||
|
||
- name: Setup GCov | ||
run: | | ||
python3 -m venv venv | ||
source venv/bin/activate | ||
pip3 install gcovr | ||
- name: Run Gcov | ||
run: | | ||
source venv/bin/activate | ||
cd build | ||
gcovr -r .. --filter '\.\./src' --html history_code_coverage.html --txt | ||
- name: Upload code coverage results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage-results | ||
path: build/history_code_coverage.html | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project(History-Output VERSION 0.0.1 LANGUAGES Fortran) | ||
|
||
set(CMAKE_Fortran_FLAGS "-O0 --coverage") | ||
if(NOT History-Output_IS_TOP_LEVEL) | ||
message(WARNING "History-Output is not integrated into the CMake build of any top level " | ||
"project yet and this CMake is for testing purposes only. " | ||
"Making a change to this project's CMake will not impact the build of " | ||
"a parent project at this time.") | ||
endif() | ||
|
||
option(HISTORY_ENABLE_TESTS "Run pFUnit unit tests" OFF) | ||
option(HISTORY_ENABLE_CODE_COVERAGE "Run code coverage tool" OFF) | ||
|
||
if(HISTORY_ENABLE_CODE_COVERAGE) | ||
add_compile_options(-O0 --coverage) | ||
add_link_options(-lgcov) | ||
endif() | ||
|
||
set(DCMAKE_BUILD_TYPE Debug) | ||
add_subdirectory(src) | ||
|
||
if(HISTORY_ENABLE_TESTS OR HISTORY_ENABLE_CODE_COVERAGE) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
set(HISTORY_SOURCES | ||
hist_api.F90 | ||
hist_buffer.F90 | ||
hist_field.F90 | ||
) | ||
|
||
add_library(history ${HISTORY_SOURCES}) | ||
|
||
target_compile_options(history PRIVATE -ffree-line-length-none) | ||
|
||
add_subdirectory(util) | ||
add_subdirectory(hash) | ||
|
||
target_include_directories(history PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set(HISTORY_HASH_SOURCES | ||
hist_hash_table.F90 | ||
hist_hashable.F90 | ||
) | ||
|
||
target_sources(history PRIVATE ${HISTORY_HASH_SOURCES}) |
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
Oops, something went wrong.