-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Verified totals for DASimpleFoam (#715)
* Added first lib with test yml. * Fixed a bug in the test script. * Added the first v4 test. * Added the missing DAOption Make. * Added test codecov * Update and rename codecov.yml to code_cov.yml * Added unit_test verification mechanism * Unify the incompressible and compressible libs. * Added more libs. * Renamed DAObjFunc to DAFunction. * More renames. * Re-structue the DAFunction. * Added more libs and delete unused DAPart and DAJac sub classes. * DASOlver compiled. * Re-organized coloring util. * Re-organized pyDASolvers. * Fixed the unit test setup file. * Added the DAInput and DAOutput classes. * Added -w to all the options files to disable warnings. * Changed the interfaces for many classes. * Changed the Allmake files. * Changed init file. * Changed mphys and pyDAFoam python layers. * Changed DASolver and add calcJacTVecProduct function. * Fixed an issue in init file. * DAOutput uses its own dicts. * Added the missing pip install for tests. * Total accurate for DASimpleFoam.
- Loading branch information
Showing
185 changed files
with
5,508 additions
and
10,127 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,45 @@ | ||
name: codecov | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
REPO_NAME: 'dafoam' | ||
DOCKER_WORKING_DIR: '/home/dafoamuser/dafoam/$REPO_NAME' | ||
DOCKER_MOUNT_DIR: '/home/dafoamuser/mount/$REPO_NAME' | ||
DOCKER_TAG: 'latest' | ||
DOCKER_ENV_FILE: '/home/dafoamuser/dafoam/loadDAFoam.sh' | ||
|
||
jobs: | ||
code_coverage: | ||
runs-on: ubuntu-20.04 | ||
name: Codecov | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
testConfig: [incompressible] | ||
include: | ||
- testConfig: incompressible | ||
args: 'incompressible' | ||
|
||
steps: | ||
- uses: actions/checkout@main | ||
- name: Create the docker container and run the tests | ||
run: | | ||
docker pull dafoam/opt-packages:${{env.DOCKER_TAG}} | ||
docker run -i -d -u dafoamuser --name regtest -v $GITHUB_WORKSPACE:${{env.DOCKER_MOUNT_DIR}} dafoam/opt-packages:${{env.DOCKER_TAG}} /bin/bash | ||
docker exec -i regtest /bin/bash -c "rm -rf ${{env.DOCKER_WORKING_DIR}} && cp -r ${{env.DOCKER_MOUNT_DIR}} ${{env.DOCKER_WORKING_DIR}}" | ||
docker exec regtest sed -i 's/-std=c++11/-std=c++11 -fprofile-arcs -ftest-coverage/g' ${{env.DOCKER_WORKING_DIR}}/src/adjoint/DAOption/Make/options | ||
docker exec regtest sed -i 's/-lfiniteVolume$(DF_LIB_SUFFIX)/-lfiniteVolume$(DF_LIB_SUFFIX) -lgcov/g' ${{env.DOCKER_WORKING_DIR}}/src/adjoint/DAOption/Make/options | ||
docker exec regtest sed -i 's/-std=c++11/-std=c++11 -fprofile-arcs -ftest-coverage/g' ${{env.DOCKER_WORKING_DIR}}/src/adjoint/DAUtility/Make/options | ||
docker exec regtest sed -i 's/-lfiniteVolume$(DF_LIB_SUFFIX)/-lfiniteVolume$(DF_LIB_SUFFIX) -lgcov/g' ${{env.DOCKER_WORKING_DIR}}/src/adjoint/DAUtility/Make/options | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake" | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && pip install ." | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}}/tests && ./Allrun" | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && lcov --capture --directory . --output-file coverage.info && echo dafoamuser | sudo -S cp -r coverage.info ${{env.DOCKER_MOUNT_DIR}}/" | ||
- name: Upload | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: true | ||
files: ./coverage.info | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
verbose: true |
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,34 @@ | ||
name: tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
REPO_NAME: 'dafoam' | ||
DOCKER_WORKING_DIR: '/home/dafoamuser/dafoam/$REPO_NAME' | ||
DOCKER_MOUNT_DIR: '/home/dafoamuser/mount/$REPO_NAME' | ||
DOCKER_TAG: 'latest' | ||
DOCKER_ENV_FILE: '/home/dafoamuser/dafoam/loadDAFoam.sh' | ||
DOCKER_OF_ADF_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADF/etc/bashrc' | ||
DOCKER_OF_ADR_BASHRC: '/home/dafoamuser/dafoam/OpenFOAM/OpenFOAM-v1812-ADR/etc/bashrc' | ||
|
||
jobs: | ||
|
||
reg_tests: | ||
runs-on: ubuntu-20.04 | ||
name: Tests | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
testConfig: [incompressible] | ||
include: | ||
- testConfig: incompressible | ||
args: 'incompressible' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create the docker container and run the tests | ||
run: | | ||
docker pull dafoam/opt-packages:${{env.DOCKER_TAG}} | ||
docker run -i -d -u dafoamuser --name regtest -v $GITHUB_WORKSPACE:${{env.DOCKER_MOUNT_DIR}} dafoam/opt-packages:${{env.DOCKER_TAG}} /bin/bash | ||
docker exec -i regtest /bin/bash -c "rm -rf ${{env.DOCKER_WORKING_DIR}} && cp -r ${{env.DOCKER_MOUNT_DIR}} ${{env.DOCKER_WORKING_DIR}}" | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}} && ./Allmake && pip install ." | ||
docker exec -i regtest /bin/bash -c ". ${{env.DOCKER_ENV_FILE}} && cd ${{env.DOCKER_WORKING_DIR}}/tests && ./Allrun" |
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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
from .pyDAFoam import PYDAFOAM | ||
from . import optFuncs | ||
from . import pyUnitTests |
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.