-
Notifications
You must be signed in to change notification settings - Fork 0
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 #12 from open-atmos/parser_stub
Parser stub
- Loading branch information
Showing
22 changed files
with
650 additions
and
6 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
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,86 @@ | ||
name: Mac | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
xcode_macos_12: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: macos-12 | ||
strategy: | ||
matrix: | ||
# all available versions of xcode: https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode | ||
xcode: ['13.1', '14.1'] | ||
build_type: [Debug, Release] | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run Cmake | ||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --parallel 10 | ||
|
||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10 | ||
xcode_macos_13: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: macos-13 | ||
strategy: | ||
matrix: | ||
# all available versions of xcode: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode | ||
xcode: ['14.1', '15.0'] | ||
build_type: [Debug, Release] | ||
env: | ||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run Cmake | ||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --parallel 10 | ||
|
||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10 | ||
macos_lateset: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
compiler: | ||
- { cpp: g++-11, c: gcc-11} | ||
- { cpp: g++-12, c: gcc-12} | ||
- { cpp: clang++, c: clang} | ||
build_type: [Debug, Release] | ||
env: | ||
CC: ${{ matrix.compiler.c }} | ||
CXX: ${{ matrix.compiler.cpp }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run Cmake | ||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --parallel 10 | ||
|
||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10 |
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,56 @@ | ||
name: Ubuntu | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
gcc: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build_type: [Debug, Release] | ||
env: | ||
CC: gcc | ||
CXX: g++ | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Cmake | ||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --parallel 10 | ||
|
||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10 | ||
clang: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build_type: [Debug, Release] | ||
env: | ||
CC: clang | ||
CXX: clang++ | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Cmake | ||
run: cmake -S . -B build -D CMAKE_BUILD_TYPE=${{ matrix.build_type }} | ||
|
||
- name: Build | ||
run: cmake --build build --verbose | ||
|
||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose -j 10 |
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,31 @@ | ||
name: Windows | ||
|
||
on: [push, pull_request] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
msvc2022: | ||
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
build_type: [Release] | ||
architecture: [Win32, x64] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run CMake | ||
run: cmake -S . -B build -A ${{ matrix.architecture }} | ||
if: matrix.build_type == 'Release' | ||
- name: Run CMake | ||
run: cmake -S . -B build -A ${{ matrix.architecture }} | ||
if: matrix.build_type == 'Debug' | ||
- name: Build | ||
run: cmake --build build --config ${{ matrix.build_type }} --parallel 10 | ||
- name: Run tests | ||
run: | | ||
cd build | ||
ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure . --verbose |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.DS_Store | ||
docs/build | ||
build |
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,51 @@ | ||
################################################################################ | ||
# Preamble | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project( | ||
mechanism_configuration | ||
VERSION 1.0.0 | ||
LANGUAGES CXX | ||
) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release" CACHE STRING | ||
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." | ||
FORCE) | ||
endif() | ||
|
||
message(STATUS "CMake build configuration for ${PROJECT_NAME} (${CMAKE_BUILD_TYPE}) ${PROJECT_VERSION}") | ||
|
||
################################################################################ | ||
# Projet wide setup options | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) | ||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake") | ||
|
||
option(ENABLE_TESTS "Build the tests" ON) | ||
|
||
################################################################################ | ||
# Dependencies | ||
|
||
include(cmake/dependencies.cmake) | ||
|
||
################################################################################ | ||
# micm targets and documentation | ||
|
||
add_subdirectory(src) | ||
|
||
################################################################################ | ||
# Tests | ||
|
||
if(PROJECT_IS_TOP_LEVEL AND ENABLE_TESTS) | ||
enable_testing() | ||
add_subdirectory(test) | ||
endif() | ||
|
||
################################################################################ | ||
# Packaging | ||
|
||
# only include packaging if we are the top level project being built | ||
if(PROJECT_IS_TOP_LEVEL) | ||
add_subdirectory(packaging) | ||
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
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,37 @@ | ||
# https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake | ||
|
||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") | ||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") | ||
endif() | ||
|
||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) | ||
string(REGEX REPLACE "\n" ";" files "${files}") | ||
foreach(file ${files}) | ||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}") | ||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") | ||
endif() | ||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") | ||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.") | ||
endif() | ||
endforeach() | ||
|
||
set(uninstall_dirs "@INSTALL_PREFIX@;@cmake_config_install_location@") | ||
|
||
foreach(dir IN LISTS uninstall_dirs) | ||
message(STATUS "Uninstalling ${dir}") | ||
exec_program( | ||
"@CMAKE_COMMAND@" ARGS "-E remove_directory ${dir}" | ||
OUTPUT_VARIABLE rm_out | ||
RETURN_VALUE rm_retval | ||
) | ||
if(NOT "${rm_retval}" STREQUAL 0) | ||
message(FATAL_ERROR "Problem when removing ${dir}") | ||
endif() | ||
endforeach() |
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,25 @@ | ||
include(FetchContent) | ||
|
||
################################################################################ | ||
# google test | ||
|
||
if(PROJECT_IS_TOP_LEVEL AND ENABLE_TESTS) | ||
FetchContent_Declare(googletest | ||
GIT_REPOSITORY https://github.com/google/googletest.git | ||
GIT_TAG v1.14.0 | ||
) | ||
|
||
set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) | ||
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE) | ||
|
||
FetchContent_MakeAvailable(googletest) | ||
endif() | ||
|
||
################################################################################ | ||
# nlohmann::json | ||
|
||
FetchContent_Declare(json | ||
GIT_REPOSITORY https://github.com/nlohmann/json.git | ||
GIT_TAG v3.11.2 | ||
) | ||
FetchContent_MakeAvailable(json) |
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,5 @@ | ||
@PACKAGE_INIT@ | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@_Exports.cmake") | ||
|
||
check_required_components("@PROJECT_NAME@") |
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,38 @@ | ||
################################################################################ | ||
# build and add a standard test | ||
|
||
function(create_standard_test) | ||
set(prefix TEST) | ||
set(optionalValues SKIP_MEMCHECK) | ||
set(singleValues NAME WORKING_DIRECTORY) | ||
set(multiValues SOURCES LIBRARIES) | ||
|
||
include(CMakeParseArguments) | ||
cmake_parse_arguments(${prefix} "${optionalValues}" "${singleValues}" "${multiValues}" ${ARGN}) | ||
|
||
add_executable(test_${TEST_NAME} ${TEST_SOURCES}) | ||
|
||
target_link_libraries(test_${TEST_NAME} PUBLIC open_atmos::mechanism_configuration GTest::gtest_main) | ||
|
||
# link additional libraries | ||
foreach(library ${TEST_LIBRARIES}) | ||
target_link_libraries(test_${TEST_NAME} PUBLIC ${library}) | ||
endforeach() | ||
|
||
if(NOT DEFINED TEST_WORKING_DIRECTORY) | ||
set(TEST_WORKING_DIRECTORY "${CMAKE_BINARY_DIR}") | ||
endif() | ||
|
||
add_open_atmos_test(${TEST_NAME} test_${TEST_NAME} "" ${TEST_WORKING_DIRECTORY}) | ||
endfunction(create_standard_test) | ||
|
||
################################################################################ | ||
# Add a test | ||
|
||
function(add_open_atmos_test test_name test_binary test_args working_dir) | ||
add_test(NAME ${test_name} | ||
COMMAND ${test_binary} ${test_args} | ||
WORKING_DIRECTORY ${working_dir}) | ||
endfunction(add_open_atmos_test) | ||
|
||
################################################################################ |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pydata-sphinx-theme | ||
setuptools | ||
sphinx | ||
sphinx-design | ||
sphinx-tabs | ||
|
Oops, something went wrong.