From f7578c827d99472372ccf1bb1149630392899e12 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 14:22:28 -0500 Subject: [PATCH 01/22] Disable all GH Actions job except Release --- .github/workflows/automated-dev-tests.yml | 424 +++++++++++----------- 1 file changed, 212 insertions(+), 212 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index bcad3daf93..20d09f4abe 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -90,235 +90,235 @@ jobs: !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/UAE_VI !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-debug: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive + # regression-tests-debug: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.7' + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install numpy Bokeh==1.4 - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure Build - working-directory: ${{runner.workspace}}/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=Debug \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - ${GITHUB_WORKSPACE} + # - name: Setup Workspace + # run: cmake -E make_directory ${{runner.workspace}}/build + # - name: Configure Build + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DCMAKE_BUILD_TYPE:STRING=Debug \ + # -DBUILD_TESTING:BOOL=ON \ + # -DCTEST_PLOT_ERRORS:BOOL=ON \ + # ${GITHUB_WORKSPACE} - - name: Build OpenFAST - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} - cmake --build . --target beamdyn_driver -- -j ${{env.NUM_PROCS}} - cmake --build . --target hydrodyn_driver -- -j ${{env.NUM_PROCS}} - cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}} + # - name: Build OpenFAST + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} + # cmake --build . --target beamdyn_driver -- -j ${{env.NUM_PROCS}} + # cmake --build . --target hydrodyn_driver -- -j ${{env.NUM_PROCS}} + # cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}} - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn - with: - test-target: regression - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn - with: - test-target: regression - - name: Run HydroDyn tests - uses: ./.github/actions/tests-module-hydrodyn - - name: Run SubDyn tests - uses: ./.github/actions/tests-module-subdyn + # - name: Run AeroDyn tests + # uses: ./.github/actions/tests-module-aerodyn + # with: + # test-target: regression + # - name: Run BeamDyn tests + # uses: ./.github/actions/tests-module-beamdyn + # with: + # test-target: regression + # - name: Run HydroDyn tests + # uses: ./.github/actions/tests-module-hydrodyn + # - name: Run SubDyn tests + # uses: ./.github/actions/tests-module-subdyn - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: regression-tests-debug - path: | - ${{runner.workspace}}/build/reg_tests/modules + # - name: Failing test artifacts + # uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: regression-tests-debug + # path: | + # ${{runner.workspace}}/build/reg_tests/modules - fastfarm-regression-test: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive + # fastfarm-regression-test: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.7' + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install numpy Bokeh==1.4 - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure Build - working-directory: ${{runner.workspace}}/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DOPENMP:BOOL=ON \ - -DBUILD_FASTFARM:BOOL=ON \ - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - ${GITHUB_WORKSPACE} - - name: Build FAST.Farm - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} - cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + # - name: Setup Workspace + # run: cmake -E make_directory ${{runner.workspace}}/build + # - name: Configure Build + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DOPENMP:BOOL=ON \ + # -DBUILD_FASTFARM:BOOL=ON \ + # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + # -DBUILD_TESTING:BOOL=ON \ + # -DCTEST_PLOT_ERRORS:BOOL=ON \ + # ${GITHUB_WORKSPACE} + # - name: Build FAST.Farm + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} + # cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} - - name: Run FAST.Farm tests - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - run: | - ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} - working-directory: ${{runner.workspace}}/build - shell: bash + # - name: Run FAST.Farm tests + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # run: | + # ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} + # working-directory: ${{runner.workspace}}/build + # shell: bash - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: test-results - path: | - ${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm + # - name: Failing test artifacts + # uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: test-results + # path: | + # ${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm - unit-test: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive - - name: Setup - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure - working-directory: ${{runner.workspace}}/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - -DBUILD_TESTING:BOOL=ON \ - ${GITHUB_WORKSPACE} + # unit-test: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive + # - name: Setup + # run: cmake -E make_directory ${{runner.workspace}}/build + # - name: Configure + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + # -DBUILD_TESTING:BOOL=ON \ + # ${GITHUB_WORKSPACE} - - name: Build unit tests - working-directory: ${{runner.workspace}}/build - run: cmake --build . --target unit_tests -- -j ${{env.NUM_PROCS}} + # - name: Build unit tests + # working-directory: ${{runner.workspace}}/build + # run: cmake --build . --target unit_tests -- -j ${{env.NUM_PROCS}} - - name: Run NWTC Library tests - uses: ./.github/actions/tests-module-nwtclibrary - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn - with: - test-target: unit - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn - with: - test-target: unit - - name: Run InflowWind tests - uses: ./.github/actions/tests-module-inflowwind + # - name: Run NWTC Library tests + # uses: ./.github/actions/tests-module-nwtclibrary + # - name: Run AeroDyn tests + # uses: ./.github/actions/tests-module-aerodyn + # with: + # test-target: unit + # - name: Run BeamDyn tests + # uses: ./.github/actions/tests-module-beamdyn + # with: + # test-target: unit + # - name: Run InflowWind tests + # uses: ./.github/actions/tests-module-inflowwind - compile-all-single-precision: - # Test if single precision compile completes. - # Compiles all targets excluding tests. - # Run with the OpenFAST registry generating the types files. - # Do not run the test suite. + # compile-all-single-precision: + # # Test if single precision compile completes. + # # Compiles all targets excluding tests. + # # Run with the OpenFAST registry generating the types files. + # # Do not run the test suite. - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive - - name: Setup - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure - working-directory: ${{runner.workspace}}/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=Debug \ - -DDOUBLE_PRECISION:BOOL=OFF \ - -DGENERATE_TYPES:BOOL=ON \ - ${GITHUB_WORKSPACE} - - name: Build all - working-directory: ${{runner.workspace}}/build - run: cmake --build . --target all -- -j ${{env.NUM_PROCS}} - - name: Test - working-directory: ${{runner.workspace}}/build - run: ./glue-codes/openfast/openfast -v + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive + # - name: Setup + # run: cmake -E make_directory ${{runner.workspace}}/build + # - name: Configure + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DCMAKE_BUILD_TYPE:STRING=Debug \ + # -DDOUBLE_PRECISION:BOOL=OFF \ + # -DGENERATE_TYPES:BOOL=ON \ + # ${GITHUB_WORKSPACE} + # - name: Build all + # working-directory: ${{runner.workspace}}/build + # run: cmake --build . --target all -- -j ${{env.NUM_PROCS}} + # - name: Test + # working-directory: ${{runner.workspace}}/build + # run: ./glue-codes/openfast/openfast -v - cpp-interface-tests: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive + # cpp-interface-tests: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - sudo apt-get update - sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.7' + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install numpy Bokeh==1.4 + # sudo apt-get update + # sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/build - - name: Configure Build - working-directory: ${{runner.workspace}}/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - -DBUILD_OPENFAST_CPP_API:BOOL=ON \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - ${GITHUB_WORKSPACE} - - name: Build OpenFAST C++ API - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - working-directory: ${{runner.workspace}}/build - run: | - cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} - cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + # - name: Setup Workspace + # run: cmake -E make_directory ${{runner.workspace}}/build + # - name: Configure Build + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + # -DBUILD_OPENFAST_CPP_API:BOOL=ON \ + # -DBUILD_SHARED_LIBS:BOOL=ON \ + # -DBUILD_TESTING:BOOL=ON \ + # -DCTEST_PLOT_ERRORS:BOOL=ON \ + # ${GITHUB_WORKSPACE} + # - name: Build OpenFAST C++ API + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # working-directory: ${{runner.workspace}}/build + # run: | + # cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} + # cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} - - name: Run OpenFAST C++ API tests - working-directory: ${{runner.workspace}}/build - run: | - ctest -VV -L cpp + # - name: Run OpenFAST C++ API tests + # working-directory: ${{runner.workspace}}/build + # run: | + # ctest -VV -L cpp - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: test-results - path: | - ${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline + # - name: Failing test artifacts + # uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: test-results + # path: | + # ${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp + # !${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline From c88d2887ee74dc7bc793007cc5eed1f2ab2a49b3 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 14:24:25 -0500 Subject: [PATCH 02/22] Run only AeroDyn module-regression tests --- .github/workflows/automated-dev-tests.yml | 29 +++++++++++++---------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 20d09f4abe..7b6225f865 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -57,24 +57,27 @@ jobs: - name: Build OpenFAST # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') working-directory: ${{runner.workspace}}/build - run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} + run: cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} - name: Run AeroDyn tests uses: ./.github/actions/tests-module-aerodyn with: test-target: regression - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn - with: - test-target: regression - - name: Run HydroDyn tests - uses: ./.github/actions/tests-module-hydrodyn - - name: Run SubDyn tests - uses: ./.github/actions/tests-module-subdyn - - name: Run OpenFAST tests - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - uses: ./.github/actions/tests-gluecode-openfast - + # - name: Run BeamDyn tests + # uses: ./.github/actions/tests-module-beamdyn + # with: + # test-target: regression + # - name: Run HydroDyn tests + # uses: ./.github/actions/tests-module-hydrodyn + # - name: Run InflowWind tests + # uses: ./.github/actions/tests-module-inflowwind + # - name: Run NWTC Library tests + # uses: ./.github/actions/tests-module-nwtclibrary + # - name: Run SubDyn tests + # uses: ./.github/actions/tests-module-subdyn + # - name: Run OpenFAST tests + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # uses: ./.github/actions/tests-gluecode-openfast - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From d31d15aff7d8f6cbbea26ecf17d214bde4dbf435 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 14:29:20 -0500 Subject: [PATCH 03/22] Use in-source build for GH Actions --- .../actions/tests-module-aerodyn/action.yml | 2 +- .../actions/tests-module-beamdyn/action.yml | 2 +- .../actions/tests-module-hydrodyn/action.yml | 2 +- .../tests-module-inflowwind/action.yml | 2 +- .../tests-module-nwtclibrary/action.yml | 2 +- .../actions/tests-module-subdyn/action.yml | 2 +- .github/workflows/automated-dev-tests.yml | 24 +++++++++---------- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/tests-module-aerodyn/action.yml b/.github/actions/tests-module-aerodyn/action.yml index 14ed3a34df..8759e9c58c 100644 --- a/.github/actions/tests-module-aerodyn/action.yml +++ b/.github/actions/tests-module-aerodyn/action.yml @@ -21,5 +21,5 @@ runs: ctest -VV -j7 -R ad_ fi - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/actions/tests-module-beamdyn/action.yml b/.github/actions/tests-module-beamdyn/action.yml index 660a2de9f6..61e13d5c54 100644 --- a/.github/actions/tests-module-beamdyn/action.yml +++ b/.github/actions/tests-module-beamdyn/action.yml @@ -20,5 +20,5 @@ runs: ctest -VV -j7 -R bd_ fi - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/actions/tests-module-hydrodyn/action.yml b/.github/actions/tests-module-hydrodyn/action.yml index 4890c414fc..3e94eba00d 100644 --- a/.github/actions/tests-module-hydrodyn/action.yml +++ b/.github/actions/tests-module-hydrodyn/action.yml @@ -5,5 +5,5 @@ runs: using: "composite" steps: - run: ctest -VV -j7 -R hd_ - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/actions/tests-module-inflowwind/action.yml b/.github/actions/tests-module-inflowwind/action.yml index 4a204980ad..b0d5faa0d9 100644 --- a/.github/actions/tests-module-inflowwind/action.yml +++ b/.github/actions/tests-module-inflowwind/action.yml @@ -5,5 +5,5 @@ runs: using: "composite" steps: - run: ctest -VV -R inflowwind_utest - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/actions/tests-module-nwtclibrary/action.yml b/.github/actions/tests-module-nwtclibrary/action.yml index a8d27e4174..d8fd57ec84 100644 --- a/.github/actions/tests-module-nwtclibrary/action.yml +++ b/.github/actions/tests-module-nwtclibrary/action.yml @@ -5,5 +5,5 @@ runs: using: "composite" steps: - run: ctest -VV -R nwtc_library_utest - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/actions/tests-module-subdyn/action.yml b/.github/actions/tests-module-subdyn/action.yml index 62d76630b9..6e1f5c7b10 100644 --- a/.github/actions/tests-module-subdyn/action.yml +++ b/.github/actions/tests-module-subdyn/action.yml @@ -5,5 +5,5 @@ runs: using: "composite" steps: - run: ctest -VV -j7 -R SD_ - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 7b6225f865..b21570dc9e 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -43,12 +43,12 @@ jobs: pip install numpy Bokeh==1.4 - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/build + run: cmake -E make_directory ${{runner.workspace}}/openfast/build - name: Configure Build - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build run: | cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DBUILD_TESTING:BOOL=ON \ @@ -56,7 +56,7 @@ jobs: ${GITHUB_WORKSPACE} - name: Build OpenFAST # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build run: cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} - name: Run AeroDyn tests @@ -84,14 +84,14 @@ jobs: with: name: regression-tests-release path: | - ${{runner.workspace}}/build/reg_tests/modules - ${{runner.workspace}}/build/reg_tests/glue-codes/openfast - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/5MW_Baseline - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/AOC - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/AWT27 - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/SWRT - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/UAE_VI - !${{runner.workspace}}/build/reg_tests/glue-codes/openfast/WP_Baseline + ${{runner.workspace}}/openfast/build/reg_tests/modules + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/5MW_Baseline + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AOC + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AWT27 + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/SWRT + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline # regression-tests-debug: # runs-on: ubuntu-20.04 From 522312cf792bd49d069aa46c24dcc3d7c5bfa7a0 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 14:41:14 -0500 Subject: [PATCH 04/22] Add CMake flags to enable code coverage profiling --- CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 998caa12b3..ce88d33cc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,6 +49,7 @@ endif() # Do this before configuring modules so that the flags are included option(BUILD_TESTING "Build the testing tree." OFF) if(BUILD_TESTING) + option(CODECOV "Enable infrastructure for measuring code coverage." OFF) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DUNIT_TEST") endif() option(BUILD_OPENFAST_SIMULINK_API "Enable building OpenFAST for use with Simulink" off) @@ -59,6 +60,24 @@ endif() # Setup Fortran Compiler options based on architecture/compiler set_fast_fortran() +# Configure measuring code coverage in tests +if(CODECOV) + # Only supports GNU + if(NOT CMAKE_Fortran_COMPILER_ID MATCHES GNU) + message(WARNING "CODECOV is only support with GNU Compilers. The current Fortran compiler is ${CMAKE_Fortran_COMPILER_ID}") + endif() + if(NOT CMAKE_CXX_COMPILER_ID MATCHES GNU) + message(WARNING "CODECOV is only support with GNU Compilers. The current C++ compiler is ${CMAKE_CXX_COMPILER_ID}") + endif() + if(NOT CMAKE_C_COMPILER_ID MATCHES GNU) + message(WARNING "CODECOV is only support with GNU Compilers. The current C compiler is ${CMAKE_C_COMPILER_ID}") + endif() + + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") +endif() + if (USE_DLL_INTERFACE) add_definitions(-DUSE_DLL_INTERFACE) endif (USE_DLL_INTERFACE) From ce3f7ff63b893804d0cef33a046f0c474417402c Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 15:12:43 -0500 Subject: [PATCH 05/22] Generate codecov report --- .github/workflows/automated-dev-tests.yml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index b21570dc9e..55aba272ef 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -17,6 +17,9 @@ on: env: FORTRAN_COMPILER: gfortran-10 + CXX_COMPILER: g++-10 + C_COMPILER: gcc-10 + GCOV_EXE: gcov-10 NUM_PROCS: 8 # runs-on: ${{ matrix.os }} @@ -42,6 +45,9 @@ jobs: python -m pip install --upgrade pip pip install numpy Bokeh==1.4 + sudo apt-get update -y + sudo apt-get install -y gcovr + - name: Setup Workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build - name: Configure Build @@ -50,8 +56,11 @@ jobs: cmake \ -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ -DBUILD_TESTING:BOOL=ON \ + -DCODECOV:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ ${GITHUB_WORKSPACE} - name: Build OpenFAST @@ -78,6 +87,18 @@ jobs: # - name: Run OpenFAST tests # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') # uses: ./.github/actions/tests-gluecode-openfast + + - name: Generate coverage report + working-directory: ${{runner.workspace}}/openfast/build + run: | + find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + + cd .. + gcovr -g -k -r . --html --html-details -o regressioncov.html # -v + + # cp `find . -name *.gcno` . + # cp `find . -name *.gcda` . + # ${{env.GCOV_EXE}} -b -l -p -c *.gcno + - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From 11d09c581bf74c7f3fafa3c72522b2756f45a6ff Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 16:06:07 -0500 Subject: [PATCH 06/22] Upload coverage report to codecov --- .github/workflows/automated-dev-tests.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 55aba272ef..5b20915812 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -98,6 +98,17 @@ jobs: # cp `find . -name *.gcno` . # cp `find . -name *.gcda` . # ${{env.GCOV_EXE}} -b -l -p -c *.gcno + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + dry_run: false + # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./regressioncov.html # optional + flags: regtests # optional + # name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) + directory: ${{runner.workspace}}/openfast - name: Failing test artifacts uses: actions/upload-artifact@v2 From 8e41d961d41a3bb8ef017eb019a619d8436be41f Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 17:09:22 -0500 Subject: [PATCH 07/22] Run codecov in debug Actions job --- .github/workflows/automated-dev-tests.yml | 134 +++++++++++++--------- 1 file changed, 81 insertions(+), 53 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 5b20915812..5109a322fd 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -125,64 +125,92 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - # regression-tests-debug: - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive + regression-tests-debug: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive - # - name: Setup Python - # uses: actions/setup-python@v2 - # with: - # python-version: '3.7' - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install numpy Bokeh==1.4 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh==1.4 - # - name: Setup Workspace - # run: cmake -E make_directory ${{runner.workspace}}/build - # - name: Configure Build - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DCMAKE_BUILD_TYPE:STRING=Debug \ - # -DBUILD_TESTING:BOOL=ON \ - # -DCTEST_PLOT_ERRORS:BOOL=ON \ - # ${GITHUB_WORKSPACE} + sudo apt-get update -y + sudo apt-get install -y gcovr - # - name: Build OpenFAST - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} - # cmake --build . --target beamdyn_driver -- -j ${{env.NUM_PROCS}} - # cmake --build . --target hydrodyn_driver -- -j ${{env.NUM_PROCS}} - # cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}} + - name: Setup Workspace + run: cmake -E make_directory ${{runner.workspace}}/openfast/build + - name: Configure Build + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DBUILD_TESTING:BOOL=ON \ + -DCODECOV:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + ${GITHUB_WORKSPACE} - # - name: Run AeroDyn tests - # uses: ./.github/actions/tests-module-aerodyn - # with: - # test-target: regression - # - name: Run BeamDyn tests - # uses: ./.github/actions/tests-module-beamdyn - # with: - # test-target: regression - # - name: Run HydroDyn tests - # uses: ./.github/actions/tests-module-hydrodyn - # - name: Run SubDyn tests - # uses: ./.github/actions/tests-module-subdyn + - name: Build OpenFAST + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} + cmake --build . --target beamdyn_driver -- -j ${{env.NUM_PROCS}} + cmake --build . --target hydrodyn_driver -- -j ${{env.NUM_PROCS}} + cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}} - # - name: Failing test artifacts - # uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: regression-tests-debug - # path: | - # ${{runner.workspace}}/build/reg_tests/modules + - name: Run AeroDyn tests + uses: ./.github/actions/tests-module-aerodyn + with: + test-target: regression + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn + with: + test-target: regression + - name: Run HydroDyn tests + uses: ./.github/actions/tests-module-hydrodyn + - name: Run SubDyn tests + uses: ./.github/actions/tests-module-subdyn + + - name: Generate coverage report + working-directory: ${{runner.workspace}}/openfast/build + run: | + find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + + cd .. + gcovr -g -k -r . --html --html-details -o regressioncov.html # -v + + # cp `find . -name *.gcno` . + # cp `find . -name *.gcda` . + # ${{env.GCOV_EXE}} -b -l -p -c *.gcno + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + dry_run: false + # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./regressioncov.html # optional + flags: regtests # optional + # name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) + directory: ${{runner.workspace}}/openfast + + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-debug + path: | + ${{runner.workspace}}/openfast/build/reg_tests/modules # fastfarm-regression-test: # runs-on: ubuntu-20.04 From 6ba540d55f15d786212fc336bec73e2d5fb9025b Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 17:19:49 -0500 Subject: [PATCH 08/22] Remove codecov from release Actions job --- .github/workflows/automated-dev-tests.yml | 54 +++++------------------ 1 file changed, 12 insertions(+), 42 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 5109a322fd..6c8901d478 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -45,9 +45,6 @@ jobs: python -m pip install --upgrade pip pip install numpy Bokeh==1.4 - sudo apt-get update -y - sudo apt-get install -y gcovr - - name: Setup Workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build - name: Configure Build @@ -58,57 +55,30 @@ jobs: -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DBUILD_TESTING:BOOL=ON \ - -DCODECOV:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ ${GITHUB_WORKSPACE} - name: Build OpenFAST # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} + run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} - name: Run AeroDyn tests uses: ./.github/actions/tests-module-aerodyn with: test-target: regression - # - name: Run BeamDyn tests - # uses: ./.github/actions/tests-module-beamdyn - # with: - # test-target: regression - # - name: Run HydroDyn tests - # uses: ./.github/actions/tests-module-hydrodyn - # - name: Run InflowWind tests - # uses: ./.github/actions/tests-module-inflowwind - # - name: Run NWTC Library tests - # uses: ./.github/actions/tests-module-nwtclibrary - # - name: Run SubDyn tests - # uses: ./.github/actions/tests-module-subdyn - # - name: Run OpenFAST tests - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # uses: ./.github/actions/tests-gluecode-openfast - - - name: Generate coverage report - working-directory: ${{runner.workspace}}/openfast/build - run: | - find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + - cd .. - gcovr -g -k -r . --html --html-details -o regressioncov.html # -v - - # cp `find . -name *.gcno` . - # cp `find . -name *.gcda` . - # ${{env.GCOV_EXE}} -b -l -p -c *.gcno - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn with: - dry_run: false - # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: ./regressioncov.html # optional - flags: regtests # optional - # name: codecov-umbrella # optional - fail_ci_if_error: true # optional (default = false) - verbose: true # optional (default = false) - directory: ${{runner.workspace}}/openfast + test-target: regression + - name: Run HydroDyn tests + uses: ./.github/actions/tests-module-hydrodyn + - name: Run SubDyn tests + uses: ./.github/actions/tests-module-subdyn + - name: Run OpenFAST tests + # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + uses: ./.github/actions/tests-gluecode-openfast - name: Failing test artifacts uses: actions/upload-artifact@v2 From bb9c0c4a382e8d42cde4ed94b8326973003dabaf Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 17:49:20 -0500 Subject: [PATCH 09/22] Post coverage report to artifacts --- .github/workflows/automated-dev-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 6c8901d478..2f922f5ec4 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -174,6 +174,13 @@ jobs: verbose: true # optional (default = false) directory: ${{runner.workspace}}/openfast + - name: Success artifacts + uses: actions/upload-artifact@v2 + if: success() + with: + name: regression-tests-debug + path: | + ${{runner.workspace}}/openfast/regressioncov.html - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From d48cd786753a5039fa51ea0c083e58f391b02356 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 17:56:45 -0500 Subject: [PATCH 10/22] Bug fix: use in source build for glue-code tests --- .github/actions/tests-gluecode-openfast/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/tests-gluecode-openfast/action.yml b/.github/actions/tests-gluecode-openfast/action.yml index e295492830..196f05a648 100644 --- a/.github/actions/tests-gluecode-openfast/action.yml +++ b/.github/actions/tests-gluecode-openfast/action.yml @@ -7,7 +7,7 @@ runs: - run: | ctest -VV -L linear -E Ideal ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,17,18,21,22,23,24,25,26,27,28,29 - working-directory: ${{runner.workspace}}/build + working-directory: ${{runner.workspace}}/openfast/build shell: bash # OpenFAST linearization tests From 6f449a942b83c711c02213f9c2818a5f8e7ba769 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 18:10:37 -0500 Subject: [PATCH 11/22] Disable release reg test job - temporarily --- .github/workflows/automated-dev-tests.yml | 124 +++++++++++----------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 2f922f5ec4..ca01e3881a 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -28,72 +28,72 @@ env: # os: [macOS-10.14, ubuntu-18.04] jobs: - regression-tests-release: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@main - with: - submodules: recursive + # regression-tests-release: + # runs-on: ubuntu-20.04 + # steps: + # - name: Checkout + # uses: actions/checkout@main + # with: + # submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.7' + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip + # pip install numpy Bokeh==1.4 - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build - working-directory: ${{runner.workspace}}/openfast/build - run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ - -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ - -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - ${GITHUB_WORKSPACE} - - name: Build OpenFAST - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} + # - name: Setup Workspace + # run: cmake -E make_directory ${{runner.workspace}}/openfast/build + # - name: Configure Build + # working-directory: ${{runner.workspace}}/openfast/build + # run: | + # cmake \ + # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ + # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + # -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + # -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + # -DBUILD_TESTING:BOOL=ON \ + # -DCTEST_PLOT_ERRORS:BOOL=ON \ + # ${GITHUB_WORKSPACE} + # - name: Build OpenFAST + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # working-directory: ${{runner.workspace}}/openfast/build + # run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn - with: - test-target: regression - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn - with: - test-target: regression - - name: Run HydroDyn tests - uses: ./.github/actions/tests-module-hydrodyn - - name: Run SubDyn tests - uses: ./.github/actions/tests-module-subdyn - - name: Run OpenFAST tests - # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - uses: ./.github/actions/tests-gluecode-openfast + # - name: Run AeroDyn tests + # uses: ./.github/actions/tests-module-aerodyn + # with: + # test-target: regression + # - name: Run BeamDyn tests + # uses: ./.github/actions/tests-module-beamdyn + # with: + # test-target: regression + # - name: Run HydroDyn tests + # uses: ./.github/actions/tests-module-hydrodyn + # - name: Run SubDyn tests + # uses: ./.github/actions/tests-module-subdyn + # - name: Run OpenFAST tests + # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + # uses: ./.github/actions/tests-gluecode-openfast - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: regression-tests-release - path: | - ${{runner.workspace}}/openfast/build/reg_tests/modules - ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/5MW_Baseline - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AOC - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AWT27 - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/SWRT - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline + # - name: Failing test artifacts + # uses: actions/upload-artifact@v2 + # if: failure() + # with: + # name: regression-tests-release + # path: | + # ${{runner.workspace}}/openfast/build/reg_tests/modules + # ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/5MW_Baseline + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AOC + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AWT27 + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/SWRT + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI + # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline regression-tests-debug: runs-on: ubuntu-20.04 From ec100ca093667284e8b4fe38e2d731b88f5a4d57 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 17 Sep 2021 18:49:29 -0500 Subject: [PATCH 12/22] Use text based coverage report --- .github/workflows/automated-dev-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index ca01e3881a..0a7835978e 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -157,7 +157,7 @@ jobs: run: | find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + cd .. - gcovr -g -k -r . --html --html-details -o regressioncov.html # -v + gcovr -g -k -r . -o regressioncov.txt # --html --html-details -o regressioncov.html # -v # cp `find . -name *.gcno` . # cp `find . -name *.gcda` . @@ -167,7 +167,7 @@ jobs: with: dry_run: false # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: ./regressioncov.html # optional + files: ./regressioncov.txt # optional flags: regtests # optional # name: codecov-umbrella # optional fail_ci_if_error: true # optional (default = false) @@ -180,7 +180,7 @@ jobs: with: name: regression-tests-debug path: | - ${{runner.workspace}}/openfast/regressioncov.html + ${{runner.workspace}}/openfast/regressioncov.txt - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From 427d8cf7a2667b2ce82ceaf7100ffc75a1d7e91e Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 20 Sep 2021 10:32:24 -0500 Subject: [PATCH 13/22] Use XML coverage report --- .github/workflows/automated-dev-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 0a7835978e..c171b3c739 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -157,7 +157,7 @@ jobs: run: | find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + cd .. - gcovr -g -k -r . -o regressioncov.txt # --html --html-details -o regressioncov.html # -v + gcovr -g -k -r . --xml regressioncov.xml # --html --html-details -o regressioncov.html # -v # cp `find . -name *.gcno` . # cp `find . -name *.gcda` . @@ -167,7 +167,7 @@ jobs: with: dry_run: false # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: ./regressioncov.txt # optional + files: ./regressioncov.xml # optional flags: regtests # optional # name: codecov-umbrella # optional fail_ci_if_error: true # optional (default = false) @@ -180,7 +180,7 @@ jobs: with: name: regression-tests-debug path: | - ${{runner.workspace}}/openfast/regressioncov.txt + ${{runner.workspace}}/openfast/regressioncov.xml - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From e009e405cbb8917d15cf5d63726d6b0b4c1dcc62 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 20 Sep 2021 11:10:23 -0500 Subject: [PATCH 14/22] Enable code coverage in unit tests --- .github/workflows/automated-dev-tests.yml | 116 ++++++++++++++++------ 1 file changed, 83 insertions(+), 33 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index c171b3c739..866eea5594 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -242,41 +242,91 @@ jobs: # path: | # ${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm - # unit-test: - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive - # - name: Setup - # run: cmake -E make_directory ${{runner.workspace}}/build - # - name: Configure - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - # -DBUILD_TESTING:BOOL=ON \ - # ${GITHUB_WORKSPACE} + unit-test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive - # - name: Build unit tests - # working-directory: ${{runner.workspace}}/build - # run: cmake --build . --target unit_tests -- -j ${{env.NUM_PROCS}} + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh==1.4 - # - name: Run NWTC Library tests - # uses: ./.github/actions/tests-module-nwtclibrary - # - name: Run AeroDyn tests - # uses: ./.github/actions/tests-module-aerodyn - # with: - # test-target: unit - # - name: Run BeamDyn tests - # uses: ./.github/actions/tests-module-beamdyn - # with: - # test-target: unit - # - name: Run InflowWind tests - # uses: ./.github/actions/tests-module-inflowwind + sudo apt-get update -y + sudo apt-get install -y gcovr + + - name: Setup Workspace + run: cmake -E make_directory ${{runner.workspace}}/openfast/build + - name: Configure Build + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DBUILD_TESTING:BOOL=ON \ + -DCODECOV:BOOL=ON \ + ${GITHUB_WORKSPACE} + + - name: Build unit tests + working-directory: ${{runner.workspace}}/openfast/build + run: cmake --build . --target unit_tests -- -j ${{env.NUM_PROCS}} + + - name: Run NWTC Library tests + uses: ./.github/actions/tests-module-nwtclibrary + - name: Run AeroDyn tests + uses: ./.github/actions/tests-module-aerodyn + with: + test-target: unit + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn + with: + test-target: unit + - name: Run InflowWind tests + uses: ./.github/actions/tests-module-inflowwind + + - name: Generate coverage report + working-directory: ${{runner.workspace}}/openfast/build + run: | + find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + + cd .. + gcovr -g -k -r . --xml unitcov.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + dry_run: false + # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./unitcov.xml # optional + flags: unittests # optional + # name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) + directory: ${{runner.workspace}}/openfast + + - name: Success artifacts + uses: actions/upload-artifact@v2 + if: success() + with: + name: unit-tests + path: | + ${{runner.workspace}}/openfast/unitcov.xml + + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: unit-tests + path: | + ${{runner.workspace}}/openfast/build/unit_tests # compile-all-single-precision: # # Test if single precision compile completes. From 103b6bf471693df81f6a2bfaa74ef19bea625afe Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 20 Sep 2021 11:24:14 -0500 Subject: [PATCH 15/22] Enable code coverage in C++ API tests --- .github/workflows/automated-dev-tests.yml | 129 ++++++++++++++-------- 1 file changed, 80 insertions(+), 49 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 866eea5594..5c90ad3939 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -359,56 +359,87 @@ jobs: # working-directory: ${{runner.workspace}}/build # run: ./glue-codes/openfast/openfast -v - # cpp-interface-tests: - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive + cpp-interface-tests: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive - # - name: Setup Python - # uses: actions/setup-python@v2 - # with: - # python-version: '3.7' - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install numpy Bokeh==1.4 - # sudo apt-get update - # sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh==1.4 - # - name: Setup Workspace - # run: cmake -E make_directory ${{runner.workspace}}/build - # - name: Configure Build - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - # -DBUILD_OPENFAST_CPP_API:BOOL=ON \ - # -DBUILD_SHARED_LIBS:BOOL=ON \ - # -DBUILD_TESTING:BOOL=ON \ - # -DCTEST_PLOT_ERRORS:BOOL=ON \ - # ${GITHUB_WORKSPACE} - # - name: Build OpenFAST C++ API - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} - # cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + sudo apt-get update -y + sudo apt-get install -y gcovr + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - # - name: Run OpenFAST C++ API tests - # working-directory: ${{runner.workspace}}/build - # run: | - # ctest -VV -L cpp + - name: Setup Workspace + run: cmake -E make_directory ${{runner.workspace}}/openfast/build + - name: Configure Build + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DBUILD_OPENFAST_CPP_API:BOOL=ON \ + -DBUILD_SHARED_LIBS:BOOL=ON \ + -DBUILD_TESTING:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + -DCODECOV:BOOL=ON \ + ${GITHUB_WORKSPACE} - # - name: Failing test artifacts - # uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: test-results - # path: | - # ${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp - # !${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline + - name: Build OpenFAST C++ API + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} + cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + + - name: Run OpenFAST C++ API tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -L cpp + + - name: Generate coverage report + working-directory: ${{runner.workspace}}/openfast/build + run: | + find . -type f -name '*.gcno' -not -path "**tests**" -exec ${{env.GCOV_EXE}} -pb {} + + cd .. + gcovr -g -k -r . --xml regressioncov.xml + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + dry_run: false + # token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos + files: ./regressioncov.xml # optional + flags: regtests # optional + # name: codecov-umbrella # optional + fail_ci_if_error: true # optional (default = false) + verbose: true # optional (default = false) + directory: ${{runner.workspace}}/openfast + + - name: Success artifacts + uses: actions/upload-artifact@v2 + if: success() + with: + name: cpp-reg-tests + path: | + ${{runner.workspace}}/openfast/regressioncov.xml + + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: cpp-reg-tests + path: | + ${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp + !${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline From ff9e61eec3bd3ce2c0340cb0866d8c171922ec52 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 20 Sep 2021 11:26:13 -0500 Subject: [PATCH 16/22] Reenable all automated tests These won't have code coverage because 1 is just a compiling test - no code execution 2 are compiled in release mode and code coverage doesn't work very well when code optimizations are enabled --- .github/workflows/automated-dev-tests.yml | 295 +++++++++++----------- 1 file changed, 147 insertions(+), 148 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 5c90ad3939..973ecdeee3 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -28,72 +28,72 @@ env: # os: [macOS-10.14, ubuntu-18.04] jobs: - # regression-tests-release: - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive - - # - name: Setup Python - # uses: actions/setup-python@v2 - # with: - # python-version: '3.7' - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install numpy Bokeh==1.4 - - # - name: Setup Workspace - # run: cmake -E make_directory ${{runner.workspace}}/openfast/build - # - name: Configure Build - # working-directory: ${{runner.workspace}}/openfast/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ - # -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ - # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - # -DBUILD_TESTING:BOOL=ON \ - # -DCTEST_PLOT_ERRORS:BOOL=ON \ - # ${GITHUB_WORKSPACE} - # - name: Build OpenFAST - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # working-directory: ${{runner.workspace}}/openfast/build - # run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} - - # - name: Run AeroDyn tests - # uses: ./.github/actions/tests-module-aerodyn - # with: - # test-target: regression - # - name: Run BeamDyn tests - # uses: ./.github/actions/tests-module-beamdyn - # with: - # test-target: regression - # - name: Run HydroDyn tests - # uses: ./.github/actions/tests-module-hydrodyn - # - name: Run SubDyn tests - # uses: ./.github/actions/tests-module-subdyn - # - name: Run OpenFAST tests - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # uses: ./.github/actions/tests-gluecode-openfast - - # - name: Failing test artifacts - # uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: regression-tests-release - # path: | - # ${{runner.workspace}}/openfast/build/reg_tests/modules - # ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/5MW_Baseline - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AOC - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AWT27 - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/SWRT - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI - # !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline + regression-tests-release: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh==1.4 + + - name: Setup Workspace + run: cmake -E make_directory ${{runner.workspace}}/openfast/build + - name: Configure Build + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ + -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DBUILD_TESTING:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + ${GITHUB_WORKSPACE} + - name: Build OpenFAST + # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + working-directory: ${{runner.workspace}}/openfast/build + run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} + + - name: Run AeroDyn tests + uses: ./.github/actions/tests-module-aerodyn + with: + test-target: regression + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn + with: + test-target: regression + - name: Run HydroDyn tests + uses: ./.github/actions/tests-module-hydrodyn + - name: Run SubDyn tests + uses: ./.github/actions/tests-module-subdyn + - name: Run OpenFAST tests + # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + uses: ./.github/actions/tests-gluecode-openfast + + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-release + path: | + ${{runner.workspace}}/openfast/build/reg_tests/modules + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/5MW_Baseline + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AOC + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/AWT27 + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/SWRT + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/UAE_VI + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline regression-tests-debug: runs-on: ubuntu-20.04 @@ -189,58 +189,57 @@ jobs: path: | ${{runner.workspace}}/openfast/build/reg_tests/modules - # fastfarm-regression-test: - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive - - # - name: Setup Python - # uses: actions/setup-python@v2 - # with: - # python-version: '3.7' - # - name: Install dependencies - # run: | - # python -m pip install --upgrade pip - # pip install numpy Bokeh==1.4 - - # - name: Setup Workspace - # run: cmake -E make_directory ${{runner.workspace}}/build - # - name: Configure Build - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DOPENMP:BOOL=ON \ - # -DBUILD_FASTFARM:BOOL=ON \ - # -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ - # -DBUILD_TESTING:BOOL=ON \ - # -DCTEST_PLOT_ERRORS:BOOL=ON \ - # ${GITHUB_WORKSPACE} - # - name: Build FAST.Farm - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} - # cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} - - # - name: Run FAST.Farm tests - # # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') - # run: | - # ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} - # working-directory: ${{runner.workspace}}/build - # shell: bash - - # - name: Failing test artifacts - # uses: actions/upload-artifact@v2 - # if: failure() - # with: - # name: test-results - # path: | - # ${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm + fastfarm-regression-test: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.7' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh==1.4 + + - name: Setup Workspace + run: cmake -E make_directory ${{runner.workspace}}/build + - name: Configure Build + working-directory: ${{runner.workspace}}/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DOPENMP:BOOL=ON \ + -DBUILD_FASTFARM:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DBUILD_TESTING:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + ${GITHUB_WORKSPACE} + - name: Build FAST.Farm + # if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All') + working-directory: ${{runner.workspace}}/build + run: | + cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} + cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + + - name: Run FAST.Farm tests + run: | + ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} + working-directory: ${{runner.workspace}}/build + shell: bash + + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: test-results + path: | + ${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm unit-test: runs-on: ubuntu-20.04 @@ -328,36 +327,36 @@ jobs: path: | ${{runner.workspace}}/openfast/build/unit_tests - # compile-all-single-precision: - # # Test if single precision compile completes. - # # Compiles all targets excluding tests. - # # Run with the OpenFAST registry generating the types files. - # # Do not run the test suite. - - # runs-on: ubuntu-20.04 - # steps: - # - name: Checkout - # uses: actions/checkout@main - # with: - # submodules: recursive - # - name: Setup - # run: cmake -E make_directory ${{runner.workspace}}/build - # - name: Configure - # working-directory: ${{runner.workspace}}/build - # run: | - # cmake \ - # -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ - # -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ - # -DCMAKE_BUILD_TYPE:STRING=Debug \ - # -DDOUBLE_PRECISION:BOOL=OFF \ - # -DGENERATE_TYPES:BOOL=ON \ - # ${GITHUB_WORKSPACE} - # - name: Build all - # working-directory: ${{runner.workspace}}/build - # run: cmake --build . --target all -- -j ${{env.NUM_PROCS}} - # - name: Test - # working-directory: ${{runner.workspace}}/build - # run: ./glue-codes/openfast/openfast -v + compile-all-single-precision: + # Test if single precision compile completes. + # Compiles all targets excluding tests. + # Run with the OpenFAST registry generating the types files. + # Do not run the test suite. + + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@main + with: + submodules: recursive + - name: Setup + run: cmake -E make_directory ${{runner.workspace}}/build + - name: Configure + working-directory: ${{runner.workspace}}/build + run: | + cmake \ + -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \ + -DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \ + -DCMAKE_BUILD_TYPE:STRING=Debug \ + -DDOUBLE_PRECISION:BOOL=OFF \ + -DGENERATE_TYPES:BOOL=ON \ + ${GITHUB_WORKSPACE} + - name: Build all + working-directory: ${{runner.workspace}}/build + run: cmake --build . --target all -- -j ${{env.NUM_PROCS}} + - name: Test + working-directory: ${{runner.workspace}}/build + run: ./glue-codes/openfast/openfast -v cpp-interface-tests: runs-on: ubuntu-20.04 From 4851df3cc157824945b70b71acbe77362ac3bb88 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 20 Sep 2021 14:52:29 -0500 Subject: [PATCH 17/22] Add codecov config file with GH comment settinsg --- .codecov.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .codecov.yaml diff --git a/.codecov.yaml b/.codecov.yaml new file mode 100644 index 0000000000..61bbaf97d5 --- /dev/null +++ b/.codecov.yaml @@ -0,0 +1,23 @@ + +comment: + layout: "reach, diff, flags, files" + behavior: default + require_changes: false + require_base: yes + require_head: yes + branches: null + +flag_management: + # this section will govern all default rules of Flags + default_rules: + carryforward: boolean? + ignore: [path]? + paths: [path]? + statuses: [ + name_prefix: string (r"^[\w\-\.]+$") + type: OR("project", "patch", "changes") + target: OR("auto", percent)? + include_changes: OR("auto", percent)? + threshold: percent? + **normal status attributes + ]? From eda6dc7555aacedd370aae4081e3fb9031cfc56a Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 23 Sep 2021 11:45:59 -0500 Subject: [PATCH 18/22] Add codecov badge to README --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index aff210097c..5f3d01da82 100644 --- a/README.rst +++ b/README.rst @@ -6,6 +6,8 @@ OpenFAST .. |actions| image:: https://github.com/openfast/openfast/actions/workflows/automated-dev-tests.yml/badge.svg?branch=dev :target: https://github.com/OpenFAST/openfast/actions/workflows/automated-dev-tests.yml?query=workflow%3A%22Development+Pipeline%22 :alt: Build Status +.. |regtest-coverage| image:: https://codecov.io/gh/openfast/openfast/branch/dev/graph/badge.svg + :target: https://codecov.io/gh/openfast/openfast .. |rtfd| image:: https://readthedocs.org/projects/openfast/badge/?version=dev :target: https://openfast.readthedocs.io/en/dev :alt: Documentation Status From 6783487ce7f7f7f14173d2b56ffc11a4dca61c7a Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 23 Sep 2021 15:54:54 -0500 Subject: [PATCH 19/22] Add codecov info in testing docs --- docs/source/testing/index.rst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/source/testing/index.rst b/docs/source/testing/index.rst index a8dad20a20..3facae17d8 100644 --- a/docs/source/testing/index.rst +++ b/docs/source/testing/index.rst @@ -27,7 +27,14 @@ to automatically execute the test suite for new commits and pull requests. This cloud computing resource is available to all GitHub users and is highly recommended as part of the development workflow. After enabling GitHub Actions in an OpenFAST repository, simply -pushing new commits will trigger the tests. +pushing new commits will trigger the tests. The GitHub Actions pipeline +is configured to measure the level of code coverage in the included +tests. These reports are currently available only for the module-level +regression tests and the unit tests, and they are available for viewing +on the `OpenFAST Codecov.io dashboard `_. +For any fork of OpenFAST where the GitHub Actions workflow successfully +completes, a unique Codecov.io dashboard will be available at +`https://app.codecov.io/gh//openfast`. Test specific documentation --------------------------- From e9a902209abb7d673d63ec26406fab9842a94758 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 23 Sep 2021 15:55:02 -0500 Subject: [PATCH 20/22] Update CMake flags list --- docs/source/install/index.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/source/install/index.rst b/docs/source/install/index.rst index 5ce068af0d..ec6ffcbc78 100644 --- a/docs/source/install/index.rst +++ b/docs/source/install/index.rst @@ -368,20 +368,21 @@ The CMake options specific to OpenFAST and their default settings are: :: BUILD_DOCUMENTATION - Build documentation (Default: OFF) + BUILD_FASTFARM - Enable FAST.Farm capabilities (Default: OFF) BUILD_OPENFAST_CPP_API - Enable building OpenFAST - C++ API (Default: OFF) - BUILD_OPENFAST_SIMULINK_API - Enable building OpenFAST for use with Simulink + BUILD_OPENFAST_SIMULINK_API - Enable building OpenFAST for use with Simulink (Default: OFF) BUILD_SHARED_LIBS - Enable building shared libraries (Default: OFF) BUILD_TESTING - Build the testing tree (Default: OFF) CMAKE_BUILD_TYPE - Choose the build type: Debug Release (Default: Release) CMAKE_Fortran_MODULE_DIRECTORY - Set the Fortran Modules directory CMAKE_INSTALL_PREFIX - Install path prefix, prepended onto install directories. + CODECOV - Enable infrastructure for measuring code coverage (Default: OFF) DOUBLE_PRECISION - Treat REAL as double precision (Default: ON) FPE_TRAP_ENABLED - Enable Floating Point Exception (FPE) trap in compiler options (Default: OFF) - GENERATE_TYPES - Use the openfast-registry to autogenerate types modules + GENERATE_TYPES - Use the openfast-registry to autogenerate types modules (Default: OFF) + OPENMP - Enable OpenMP support (Default: OFF) ORCA_DLL_LOAD - Enable OrcaFlex library load (Default: OFF) USE_DLL_INTERFACE - Enable runtime loading of dynamic libraries (Default: ON) - OPENMP - Enable OpenMP support (Default: OFF) - BUILD_FAST_FARM - Enable FAST.Farm capabilities (Default: OFF) Additional system-specific options may exist for a given system, but those should not impact the OpenFAST configuration. As mentioned above, the From 7e5d2ed6377e6c6bb1db1d7b91845881180c79bf Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 23 Sep 2021 16:00:11 -0500 Subject: [PATCH 21/22] Add CMake warning for code coverage and not debug --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce88d33cc2..066493ae06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,13 +64,18 @@ set_fast_fortran() if(CODECOV) # Only supports GNU if(NOT CMAKE_Fortran_COMPILER_ID MATCHES GNU) - message(WARNING "CODECOV is only support with GNU Compilers. The current Fortran compiler is ${CMAKE_Fortran_COMPILER_ID}") + message(WARNING "CODECOV is only support with GNU Compilers. The current Fortran compiler is ${CMAKE_Fortran_COMPILER_ID}.") endif() if(NOT CMAKE_CXX_COMPILER_ID MATCHES GNU) - message(WARNING "CODECOV is only support with GNU Compilers. The current C++ compiler is ${CMAKE_CXX_COMPILER_ID}") + message(WARNING "CODECOV is only support with GNU Compilers. The current C++ compiler is ${CMAKE_CXX_COMPILER_ID}.") endif() if(NOT CMAKE_C_COMPILER_ID MATCHES GNU) - message(WARNING "CODECOV is only support with GNU Compilers. The current C compiler is ${CMAKE_C_COMPILER_ID}") + message(WARNING "CODECOV is only support with GNU Compilers. The current C compiler is ${CMAKE_C_COMPILER_ID}.") + endif() + + string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) + if (NOT ${_build_type} STREQUAL "DEBUG") + message(WARNING "CODECOV reporting may be inaccurate with compiler optimizations on. Please run with CMAKE_BUILD_TYPE=DEBUG.") endif() set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} --coverage") From 47e5fae8e6b671cdfb5a29cada88ff4b8d7750e2 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 23 Sep 2021 16:51:36 -0500 Subject: [PATCH 22/22] Use portable method to install system dependencies --- .github/workflows/automated-dev-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index ef3a2a1e85..d78965f65e 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -99,8 +99,10 @@ jobs: include: - os: macOS-11 FORTRAN_COMPILER: gfortran-11 + install_deps: brew install gcovr - os: ubuntu-20.04 FORTRAN_COMPILER: gfortran-10 + install_deps: sudo apt-get install -y gcovr name: regression-test-debug-${{ matrix.os }}-${{ matrix.FORTRAN_COMPILER }} steps: @@ -113,13 +115,11 @@ jobs: uses: actions/setup-python@v2 with: python-version: '3.7' - - name: Install dependencies + - name: Install Dependencies run: | python -m pip install --upgrade pip pip install numpy Bokeh==1.4 - - sudo apt-get update -y - sudo apt-get install -y gcovr + ${{matrix.install_deps}} - name: Setup Workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build