From 7ed465503c0caf4f43e8809f8d974de97149a3b2 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 9 Jun 2022 20:52:40 -0500 Subject: [PATCH 1/8] Add parallel jobs to improve Actions reg test time --- .github/workflows/automated-dev-tests.yml | 865 ++++++++++++++-------- reg_tests/CMakeLists.txt | 20 +- 2 files changed, 574 insertions(+), 311 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index fd63edb92c..0137d1e01b 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -1,4 +1,4 @@ - + name: 'Development Pipeline' on: @@ -25,26 +25,31 @@ env: jobs: - regression-tests-aerodyn-driver: + ### BUILD JOBS + + + build-all-debug: + # Tests compiling in debug mode. + # TODO: NOT ENABLED Single precision compile checks that the precision types are correctly set. + # Debug more speeds up the build. runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@main with: submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' + python-version: '3.9' + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - - - name: Setup Workspace + pip install numpy Bokeh + - name: Setup workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build + - name: Configure build working-directory: ${{runner.workspace}}/openfast/build run: | cmake \ @@ -52,47 +57,43 @@ 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=RelWithDebInfo \ + -DCMAKE_BUILD_TYPE:STRING=DEBUG \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ + -DVARIABLE_TRACKING=OFF \ -DBUILD_TESTING:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ ${GITHUB_WORKSPACE} - - name: Build AeroDyn Driver + # -DDOUBLE_PRECISION=OFF \ + - name: Build all working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}} - - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn + run: | + cmake --build . --target all -- -j ${{env.NUM_PROCS}} + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - test-target: regression + path: ${{runner.workspace}} + key: build-all-debug-${{ github.sha }} - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: regression-tests-aerodyn-module - path: | - ${{runner.workspace}}/openfast/build/reg_tests/modules - regression-tests-release: + build-drivers-release: runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@main with: submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' + python-version: '3.9' + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - - - name: Setup Workspace + pip install numpy Bokeh + - name: Setup workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build + - name: Configure build working-directory: ${{runner.workspace}}/openfast/build run: | cmake \ @@ -101,403 +102,649 @@ jobs: -DCMAKE_CXX_COMPILER:STRING=${{env.CXX_COMPILER}} \ -DCMAKE_C_COMPILER:STRING=${{env.C_COMPILER}} \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ + -DVARIABLE_TRACKING=OFF \ -DBUILD_TESTING:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ - -DVARIABLE_TRACKING=OFF \ ${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') + - name: Build module drivers working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target install -- -j ${{env.NUM_PROCS}} - - # SubDyn has only regression tests - - name: Run SubDyn tests - uses: ./.github/actions/tests-module-subdyn - # - name: Run AeroDyn tests - # uses: ./.github/actions/tests-module-aerodyn - # with: - # test-target: regression - # HydroDyn has only regression tests - - name: Run HydroDyn tests - uses: ./.github/actions/tests-module-hydrodyn - - name: Run InflowWind tests - uses: ./.github/actions/tests-module-inflowwind - with: - test-target: regression - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn + run: | + cmake --build . --target regression_test_module_drivers -- -j ${{env.NUM_PROCS}} + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - test-target: regression - - 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 + path: ${{runner.workspace}} + key: build-drivers-release-${{ github.sha }} - - 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: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - 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 update && sudo apt-get install -y gcovr - - name: regression-test-debug-${{ matrix.os }}-${{ matrix.FORTRAN_COMPILER }} + build-postlib-release: + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@main with: submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' - - name: Install Dependencies + python-version: '3.9' + cache: 'pip' + - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - ${{matrix.install_deps}} - - - name: Setup Workspace + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev # gcovr + - name: Setup workspace run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build + - name: Configure build working-directory: ${{runner.workspace}}/openfast/build run: | cmake \ -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \ - -DCMAKE_Fortran_COMPILER:STRING=${{matrix.FORTRAN_COMPILER}} \ + -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 \ + -DOPENMP:BOOL=ON \ + -DDOUBLE_PRECISION=ON \ + -DVARIABLE_TRACKING=OFF \ + -DBUILD_FASTFARM:BOOL=ON \ + -DBUILD_OPENFAST_CPP_API:BOOL=ON \ + -DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_TESTING:BOOL=ON \ -DCTEST_PLOT_ERRORS:BOOL=ON \ ${GITHUB_WORKSPACE} + - name: Build openfast-postlib + working-directory: ${{runner.workspace}}/openfast/build + run: cmake --build . --target openfast_postlib -- -j ${{env.NUM_PROCS}} + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-postlib-release-${{ github.sha }} + - - name: Build Drivers + build-interfaces-release: + runs-on: ubuntu-20.04 + needs: build-postlib-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-postlib-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Build OpenFAST C-Interfaces 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 inflowwind_driver -- -j ${{env.NUM_PROCS}} - cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}} + cmake --build . --target openfastlib -- -j ${{env.NUM_PROCS}} + cmake --build . --target openfast_cpp -- -j ${{env.NUM_PROCS}} + cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} + cmake --build . --target ifw_c_binding -- -j ${{env.NUM_PROCS}} + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-interfaces-release-${{ github.sha }} - - 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 HydroDyn tests - uses: ./.github/actions/tests-module-hydrodyn - - name: Run InflowWind tests - uses: ./.github/actions/tests-module-inflowwind + + build-openfast-release: + runs-on: ubuntu-20.04 + needs: build-postlib-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-postlib-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Build OpenFAST glue-code + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target openfast -- -j ${{env.NUM_PROCS}} + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + + + build-fastfarm-release: + runs-on: ubuntu-20.04 + needs: build-postlib-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-postlib-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Build FAST.Farm + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} + - name: Upload build + uses: actions/upload-artifact@main + with: + name: fastfarm-build + path: build-fastfarm-${{ github.sha }}.tar + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-fastfarm-release-${{ github.sha }} + + + ### TEST JOBS + + regression-tests-module-drivers: + runs-on: ubuntu-20.04 + needs: build-drivers-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-drivers-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - 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 - - # Disabled Codecov since the dashboard and GitHub comments were buggy, - # but it may be useful to post the gcov coverage reports to GitHub Actions - # artifacts. - # Note: if reenabling Codecov, the reports must be in xml format not html. - # - 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: Success artifacts - # uses: actions/upload-artifact@v2 - # if: success() - # with: - # name: regression-tests-debug - # path: | - # ${{runner.workspace}}/openfast/regressioncov.html + - name: Run HydroDyn tests + uses: ./.github/actions/tests-module-hydrodyn + - name: Run InflowWind tests + uses: ./.github/actions/tests-module-inflowwind + with: + test-target: regression + - 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 + name: regression-tests-aerodyn-module path: | ${{runner.workspace}}/openfast/build/reg_tests/modules - fastfarm-regression-test: + + regression-tests-interfaces: runs-on: ubuntu-20.04 + needs: build-interfaces-release steps: - - name: Checkout - uses: actions/checkout@main + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - submodules: recursive - + path: ${{runner.workspace}} + key: build-interfaces-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' + python-version: '3.9' + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Run Interface / API tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -L "cpp|python" -j ${{env.NUM_PROCS}} + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: c-interface-reg-tests + path: | + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp + ${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build + + regression-tests-openfast-5MW: + runs-on: ubuntu-20.04 + needs: build-openfast-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests working-directory: ${{runner.workspace}}/openfast/build run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/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 \ - -DVARIABLE_TRACKING=OFF \ - ${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') + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}} - cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + ctest -VV -j8 -L openfast -LE "cpp|linear|python" -R 5MW_ -E "5MW_Land_BD_DLL_WTurb|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Semi_WSt_WavesWN|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-5MW + 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: Run FAST.Farm tests + + regression-tests-openfast-5MW_OC4Semi_WSt_WavesWN: + runs-on: ubuntu-20.04 + needs: build-openfast-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies run: | - ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests working-directory: ${{runner.workspace}}/openfast/build - shell: bash - + run: | + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -L openfast -LE "linear|python" -R 5MW_OC4Semi_WSt_WavesWN - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: test-results + name: regression-tests-5MW_OC4Semi_WSt_WavesWN path: | - ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/fastfarm + ${{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 + - unit-test: + regression-tests-openfast-5MW_OC3Mnpl_DLL_WTurb_WavesIrr: runs-on: ubuntu-20.04 + needs: build-openfast-release steps: - - name: Checkout - uses: actions/checkout@main + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - submodules: recursive - + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' + python-version: '3.9' + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - + pip install numpy Bokeh 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 + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests 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 \ - ${GITHUB_WORKSPACE} - - - name: Build unit tests + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target unit_tests -- -j ${{env.NUM_PROCS}} + run: | + ctest -VV -L openfast -LE "linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-5MW_OC3Mnpl_DLL_WTurb_WavesIrr + 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 - # NWTC Library has only unit tests - - name: Run NWTC Library tests - uses: ./.github/actions/tests-module-nwtclibrary - # VersionInfo has only unit tests - - name: Run VersionInfo tests - uses: ./.github/actions/tests-module-version - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn + + regression-tests-openfast-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth: + runs-on: ubuntu-20.04 + needs: build-openfast-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - test-target: unit - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 with: - test-target: unit - - name: Run InflowWind tests - uses: ./.github/actions/tests-module-inflowwind + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -L openfast -LE "linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() with: - test-target: unit + name: regression-tests-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth + 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 - # Disabled Codecov since the dashboard and GitHub comments were buggy, - # but it may be useful to post the gcov coverage reports to GitHub Actions - # artifacts. - # Note: if reenabling Codecov, the reports must be in xml format not html. - # - 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 unitcov.html - # - name: Success artifacts - # uses: actions/upload-artifact@v2 - # if: success() - # with: - # name: unit-tests - # path: | - # ${{runner.workspace}}/openfast/unitcov.html + regression-tests-openfast-5MW_OC3Trpd_DLL_WSt_WavesReg: + runs-on: ubuntu-20.04 + needs: build-openfast-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -L openfast -LE "linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: unit-tests + name: regression-tests-5MW_OC3Trpd_DLL_WSt_WavesReg path: | - ${{runner.workspace}}/openfast/build/unit_tests + ${{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 - 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. + regression-tests-openfast-5MW_Land_BD_DLL_WTurb: runs-on: ubuntu-20.04 + needs: build-openfast-release steps: - - name: Checkout - uses: actions/checkout@main + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - submodules: recursive - - name: Setup - run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure - working-directory: ${{runner.workspace}}/openfast/build + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies run: | - cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/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 + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests working-directory: ${{runner.workspace}}/openfast/build - run: cmake --build . --target all -- -j ${{env.NUM_PROCS}} - - name: Test + run: | + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build - run: ./glue-codes/openfast/openfast -v + run: | + ctest -VV -L openfast -LE "linear|python" -R 5MW_Land_BD_DLL_WTurb + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-5MW_Land_BD_DLL_WTurb + 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 + - interface-tests: + regression-tests-openfast-not-5MW: runs-on: ubuntu-20.04 + needs: build-openfast-release steps: - - name: Checkout - uses: actions/checkout@main + - name: Cache the workspace + uses: actions/cache@v3.0.4 with: - submodules: recursive - + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: - python-version: '3.7' + python-version: '3.9' + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install numpy Bokeh==1.4 - + pip install numpy Bokeh sudo apt-get update -y - sudo apt-get install -y gcovr sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - - - name: Setup Workspace - run: cmake -E make_directory ${{runner.workspace}}/openfast/build - - name: Configure Build + - name: Configure Tests 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_OPENFAST_CPP_API:BOOL=ON \ - -DBUILD_SHARED_LIBS:BOOL=ON \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - -DVARIABLE_TRACKING=OFF \ - ${GITHUB_WORKSPACE} - - - name: Build OpenFAST C-Interfaces + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run non-5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - cmake --build . --target openfastlib -- -j ${{env.NUM_PROCS}} - cmake --build . --target openfast_cpp -- -j ${{env.NUM_PROCS}} - cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} - cmake --build . --target hydrodyn_c_binding -- -j ${{env.NUM_PROCS}} - cmake --build . --target ifw_c_binding -- -j ${{env.NUM_PROCS}} - cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}} + ctest -VV -j8 -E 5MW_ -L openfast -LE "python|cpp" + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-not-5MW + 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: Run C++ API tests + regression-tests-fastfarm: + runs-on: ubuntu-20.04 + needs: build-fastfarm-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-fastfarm-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L cpp - - - name: Run Python API tests + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run FAST.Farm tests working-directory: ${{runner.workspace}}/openfast/build + shell: bash run: | - ctest -VV -L python - - # Disabled Codecov since the dashboard and GitHub comments were buggy, - # but it may be useful to post the gcov coverage reports to GitHub Actions - # artifacts. - # Note: if reenabling Codecov, the reports must be in xml format not html. - # - 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 regressioncov.html - # - name: Success artifacts - # uses: actions/upload-artifact@v2 - # if: success() - # with: - # name: c-interface-reg-tests - # path: | - # ${{runner.workspace}}/openfast/regressioncov.html + ctest -VV -L fastfarm -j ${{env.NUM_PROCS}} + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: fastfarm-tests-release + path: | + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/fastfarm + + module-tests-debug: + runs-on: ubuntu-20.04 + needs: build-all-debug + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-all-debug-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake \ + -DBUILD_TESTING:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + ${GITHUB_WORKSPACE} + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run AeroDyn tests + uses: ./.github/actions/tests-module-aerodyn + with: + # Don't run regression tests here since they currently fail inconsistently + test-target: unit + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn + - 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 VersionInfo tests + uses: ./.github/actions/tests-module-version - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: interface-reg-tests + name: debug-tests-release path: | - ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp - ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/python - ${{runner.workspace}}/openfast/build/reg_tests/modules/hydrodyn - ${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline + ${{runner.workspace}}/openfast/build/reg_tests/modules + ${{runner.workspace}}/openfast/build/unit_tests diff --git a/reg_tests/CMakeLists.txt b/reg_tests/CMakeLists.txt index 3587cd56d2..38451a4247 100644 --- a/reg_tests/CMakeLists.txt +++ b/reg_tests/CMakeLists.txt @@ -163,9 +163,8 @@ add_custom_command( ) add_custom_target( - regression_tests + regression_test_controllers DEPENDS - openfast "${of_dest}/DISCON.dll" "${of_dest}/DISCON_ITIBarge.dll" "${of_dest}/DISCON_OC3Hywind.dll" @@ -176,3 +175,20 @@ add_custom_target( "${ff_dest}/DISCON_WT2.dll" "${ff_dest}/DISCON_WT3.dll" ) + +add_custom_target( + regression_tests + DEPENDS + openfast + regression_test_controllers +) + +add_custom_target( + regression_test_module_drivers + DEPENDS + aerodyn_driver + beamdyn_driver + hydrodyn_driver + inflowwind_driver + subdyn_driver +) \ No newline at end of file From 5a8ec2669aed688d99a76315783f69a5a0cac1e6 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Sun, 10 Jul 2022 10:25:44 -0500 Subject: [PATCH 2/8] Configure OpenFAST Library as shared library --- modules/openfast-library/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openfast-library/CMakeLists.txt b/modules/openfast-library/CMakeLists.txt index f6496a8cb1..b838662c2d 100644 --- a/modules/openfast-library/CMakeLists.txt +++ b/modules/openfast-library/CMakeLists.txt @@ -53,8 +53,9 @@ add_library(openfast_postlib ) target_link_libraries(openfast_postlib openfast_prelib scdataexlib foamfastlib versioninfolib) -add_library(openfastlib src/FAST_Library.f90) +add_library(openfastlib SHARED src/FAST_Library.f90) target_link_libraries(openfastlib openfast_postlib openfast_prelib scdataexlib foamfastlib) +set_property(TARGET openfastlib PROPERTY LINKER_LANGUAGE Fortran) string(TOUPPER ${CMAKE_Fortran_COMPILER_ID} _compiler_id) string(TOUPPER ${CMAKE_BUILD_TYPE} _build_type) From c4d2ca8f48f2b930407f4f54e7bd8b271af59326 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 11 Jul 2022 17:22:03 -0500 Subject: [PATCH 3/8] Add fPIC flag for MAP++ This is required on unix to link with openfastlib shared library. For the difference on fpic and fPIC, see https://stackoverflow.com/questions/3544035/what-is-the-difference-between-fpic-and-fpic-gcc-parameters https://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html --- modules/map/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/map/CMakeLists.txt b/modules/map/CMakeLists.txt index 2bf1de3f4c..2589d5a893 100644 --- a/modules/map/CMakeLists.txt +++ b/modules/map/CMakeLists.txt @@ -19,6 +19,11 @@ if(WIN32 OR CYGWIN OR MINGW) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAP_DLL_EXPORTS -DCMINPACK_NO_DLL -DNDEBUG -D_WINDOWS -D_USRDLL") endif() +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +endif() + if (GENERATE_TYPES) generate_f90_types(src/MAP_Fortran_Registry.txt ${CMAKE_CURRENT_LIST_DIR}/src/MAP_Fortran_Types.f90 -noextrap) generate_f90_types(src/MAP_Registry.txt ${CMAKE_CURRENT_LIST_DIR}/src/MAP_Types.f90 -ccode) From 7693fa1fe86785d94dbc1a06c763e4285acdb552 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 14 Jul 2022 09:18:37 -0500 Subject: [PATCH 4/8] Add a branch for linearization tests --- .github/workflows/automated-dev-tests.yml | 56 ++++++++++++++++++++--- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index 0137d1e01b..a2bdbd68a8 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -420,7 +420,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "linear|python" -R 5MW_OC4Semi_WSt_WavesWN + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Semi_WSt_WavesWN - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() @@ -464,7 +464,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() @@ -508,7 +508,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() @@ -552,7 +552,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() @@ -596,7 +596,7 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "linear|python" -R 5MW_Land_BD_DLL_WTurb + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_Land_BD_DLL_WTurb - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() @@ -640,7 +640,51 @@ jobs: - name: Run non-5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -j8 -E 5MW_ -L openfast -LE "python|cpp" + ctest -VV -j8 -E 5MW_ -L openfast -LE "cpp|linear|python" + - name: Failing test artifacts + uses: actions/upload-artifact@v2 + if: failure() + with: + name: regression-tests-not-5MW + 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-openfast-linearization: + runs-on: ubuntu-20.04 + needs: build-openfast-release + steps: + - name: Cache the workspace + uses: actions/cache@v3.0.4 + with: + path: ${{runner.workspace}} + key: build-openfast-release-${{ github.sha }} + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: '3.9' + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy Bokeh + sudo apt-get update -y + sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev + - name: Configure Tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run OpenFAST linearization tests + working-directory: ${{runner.workspace}}/openfast/build + run: | + ctest -VV -j8 -L linear - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() From 78fc18774b46568ff9bbfade22e88c8c7373c014 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 14 Jul 2022 09:27:44 -0500 Subject: [PATCH 5/8] Consolidate tests and improve naming --- .github/workflows/automated-dev-tests.yml | 175 +++++++++------------- 1 file changed, 68 insertions(+), 107 deletions(-) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index a2bdbd68a8..a463da8ee9 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -269,7 +269,7 @@ jobs: ### TEST JOBS - regression-tests-module-drivers: + rtest-module-drivers: runs-on: ubuntu-20.04 needs: build-drivers-release steps: @@ -309,20 +309,20 @@ jobs: uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-aerodyn-module + name: rtest-module-drivers path: | ${{runner.workspace}}/openfast/build/reg_tests/modules - regression-tests-interfaces: + rtest-modules-debug: runs-on: ubuntu-20.04 - needs: build-interfaces-release + needs: build-all-debug steps: - name: Cache the workspace uses: actions/cache@v3.0.4 with: path: ${{runner.workspace}} - key: build-interfaces-release-${{ github.sha }} + key: build-all-debug-${{ github.sha }} - name: Setup Python uses: actions/setup-python@v3 with: @@ -334,30 +334,50 @@ jobs: pip install numpy Bokeh sudo apt-get update -y sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - - name: Run Interface / API tests + - name: Configure Tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L "cpp|python" -j ${{env.NUM_PROCS}} + cmake \ + -DBUILD_TESTING:BOOL=ON \ + -DCTEST_PLOT_ERRORS:BOOL=ON \ + ${GITHUB_WORKSPACE} + cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} + - name: Run AeroDyn tests + uses: ./.github/actions/tests-module-aerodyn + with: + # Don't run regression tests here since they currently fail inconsistently + test-target: unit + - name: Run BeamDyn tests + uses: ./.github/actions/tests-module-beamdyn + - 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 VersionInfo tests + uses: ./.github/actions/tests-module-version - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: c-interface-reg-tests + name: rtest-modules-debug path: | - ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp - ${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind - !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline + ${{runner.workspace}}/openfast/build/reg_tests/modules + ${{runner.workspace}}/openfast/build/unit_tests - regression-tests-openfast-5MW: + rtest-interfaces: runs-on: ubuntu-20.04 - needs: build-openfast-release + needs: build-interfaces-release steps: - name: Cache the workspace uses: actions/cache@v3.0.4 with: path: ${{runner.workspace}} - key: build-openfast-release-${{ github.sha }} + key: build-interfaces-release-${{ github.sha }} - name: Setup Python uses: actions/setup-python@v3 with: @@ -369,31 +389,24 @@ jobs: pip install numpy Bokeh sudo apt-get update -y sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - - name: Configure Tests - working-directory: ${{runner.workspace}}/openfast/build - run: | - cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} - - name: Run 5MW tests + - name: Run Interface / API tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -j8 -L openfast -LE "cpp|linear|python" -R 5MW_ -E "5MW_Land_BD_DLL_WTurb|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Semi_WSt_WavesWN|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth" + ctest -VV -L "cpp|python" -j ${{env.NUM_PROCS}} - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW + name: rtest-interfaces 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 + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp + ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/python + ${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind + ${{runner.workspace}}/openfast/build/reg_tests/modules/hydrodyn + !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline - regression-tests-openfast-5MW_OC4Semi_WSt_WavesWN: + rtest-OF: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -420,12 +433,15 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Semi_WSt_WavesWN + ctest -VV -j8 \ + -L openfast \ + -LE "cpp|linear|python" \ + -E "5MW_OC4Semi_WSt_WavesWN|5MW_OC3Mnpl_DLL_WTurb_WavesIrr|5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth|5MW_OC3Trpd_DLL_WSt_WavesReg|5MW_Land_BD_DLL_WTurb" - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW_OC4Semi_WSt_WavesWN + name: rtest-OF path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -437,7 +453,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-5MW_OC3Mnpl_DLL_WTurb_WavesIrr: + rtest-OF-5MW_OC4Semi_WSt_WavesWN: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -464,12 +480,12 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Semi_WSt_WavesWN - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW_OC3Mnpl_DLL_WTurb_WavesIrr + name: rtest-OF-5MW_OC4Semi_WSt_WavesWN path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -481,7 +497,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth: + rtest-OF-5MW_OC3Mnpl_DLL_WTurb_WavesIrr: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -508,12 +524,12 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Mnpl_DLL_WTurb_WavesIrr - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth + name: rtest-OF-5MW_OC3Mnpl_DLL_WTurb_WavesIrr path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -525,7 +541,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-5MW_OC3Trpd_DLL_WSt_WavesReg: + rtest-OF-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -552,12 +568,12 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW_OC3Trpd_DLL_WSt_WavesReg + name: rtest-OF-5MW_OC4Jckt_DLL_WTurb_WavesIrr_MGrowth path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -569,7 +585,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-5MW_Land_BD_DLL_WTurb: + rtest-OF-5MW_OC3Trpd_DLL_WSt_WavesReg: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -596,12 +612,12 @@ jobs: - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_Land_BD_DLL_WTurb + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_OC3Trpd_DLL_WSt_WavesReg - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-5MW_Land_BD_DLL_WTurb + name: rtest-OF-5MW_OC3Trpd_DLL_WSt_WavesReg path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -613,7 +629,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-not-5MW: + rtest-OF-5MW_Land_BD_DLL_WTurb: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -637,15 +653,15 @@ jobs: working-directory: ${{runner.workspace}}/openfast/build run: | cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} - - name: Run non-5MW tests + - name: Run 5MW tests working-directory: ${{runner.workspace}}/openfast/build run: | - ctest -VV -j8 -E 5MW_ -L openfast -LE "cpp|linear|python" + ctest -VV -L openfast -LE "cpp|linear|python" -R 5MW_Land_BD_DLL_WTurb - name: Failing test artifacts uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-not-5MW + name: rtest-OF-5MW_Land_BD_DLL_WTurb path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -657,7 +673,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-openfast-linearization: + rtest-OF-linearization: runs-on: ubuntu-20.04 needs: build-openfast-release steps: @@ -689,7 +705,7 @@ jobs: uses: actions/upload-artifact@v2 if: failure() with: - name: regression-tests-not-5MW + name: rtest-OF-linearization path: | ${{runner.workspace}}/openfast/build/reg_tests/modules ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast @@ -701,7 +717,7 @@ jobs: !${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast/WP_Baseline - regression-tests-fastfarm: + rtest-FF: runs-on: ubuntu-20.04 needs: build-fastfarm-release steps: @@ -734,61 +750,6 @@ jobs: uses: actions/upload-artifact@v2 if: failure() with: - name: fastfarm-tests-release + name: rtest-FF path: | ${{runner.workspace}}/openfast/build/reg_tests/glue-codes/fastfarm - - - module-tests-debug: - runs-on: ubuntu-20.04 - needs: build-all-debug - steps: - - name: Cache the workspace - uses: actions/cache@v3.0.4 - with: - path: ${{runner.workspace}} - key: build-all-debug-${{ github.sha }} - - name: Setup Python - uses: actions/setup-python@v3 - with: - python-version: '3.9' - cache: 'pip' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install numpy Bokeh - sudo apt-get update -y - sudo apt-get install -y libhdf5-dev libopenmpi-dev libyaml-cpp-dev - - name: Configure Tests - working-directory: ${{runner.workspace}}/openfast/build - run: | - cmake \ - -DBUILD_TESTING:BOOL=ON \ - -DCTEST_PLOT_ERRORS:BOOL=ON \ - ${GITHUB_WORKSPACE} - cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} - - name: Run AeroDyn tests - uses: ./.github/actions/tests-module-aerodyn - with: - # Don't run regression tests here since they currently fail inconsistently - test-target: unit - - name: Run BeamDyn tests - uses: ./.github/actions/tests-module-beamdyn - - 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 VersionInfo tests - uses: ./.github/actions/tests-module-version - - name: Failing test artifacts - uses: actions/upload-artifact@v2 - if: failure() - with: - name: debug-tests-release - path: | - ${{runner.workspace}}/openfast/build/reg_tests/modules - ${{runner.workspace}}/openfast/build/unit_tests From 3aa7f39bad967205b8cc31c2b6f054a267c376aa Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Thu, 14 Jul 2022 10:35:45 -0500 Subject: [PATCH 6/8] Disable variable tracking on all FF modules --- glue-codes/fast-farm/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glue-codes/fast-farm/CMakeLists.txt b/glue-codes/fast-farm/CMakeLists.txt index f404db7fab..c6ad9ffc75 100644 --- a/glue-codes/fast-farm/CMakeLists.txt +++ b/glue-codes/fast-farm/CMakeLists.txt @@ -51,6 +51,9 @@ if (${_compiler_id} STREQUAL "GNU" AND NOT ${VARIABLE_TRACKING}) # for better runtime debugging output. # https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html set_source_files_properties(src/FAST_Farm_Types.f90 src/FASTWrapper_Types.f90 src/FASTWrapper.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments") + set_source_files_properties(src/FAST_Farm_IO.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments") + set_source_files_properties(src/FAST_Farm_Subs.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments") + set_source_files_properties(src/FAST_Farm.f90 PROPERTIES COMPILE_FLAGS "-fno-var-tracking -fno-var-tracking-assignments") endif() if (${_compiler_id} MATCHES "^INTEL" AND ${_build_type} STREQUAL "RELEASE" AND NOT WIN32) # Compilation hangs on FAST_Farm_Types.f90 with -O3 on linux (on some hardware) From 6d9d1c978ca7f6a211e0d232d9e6e8f1f9b63523 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 29 Jul 2022 13:48:29 -0500 Subject: [PATCH 7/8] Update ideal beam linearization test baselines These were not previously run in Actions so it was not caught that the baselines were out of date --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index e8efa89461..cd9a7a4f27 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit e8efa89461f6a7de4ffe3e9416d2ff5dabfb566d +Subproject commit cd9a7a4f27f4197dfd3d1ba699fd24a4c7f1aea4 From 5099377d24459307890c9ffb374fb30994c64281 Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Fri, 29 Jul 2022 14:00:01 -0500 Subject: [PATCH 8/8] Build HydroDyn C-interface for interface tests --- .github/workflows/automated-dev-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/automated-dev-tests.yml b/.github/workflows/automated-dev-tests.yml index a463da8ee9..06ebebcf22 100644 --- a/.github/workflows/automated-dev-tests.yml +++ b/.github/workflows/automated-dev-tests.yml @@ -192,6 +192,7 @@ jobs: cmake --build . --target openfast_cpp -- -j ${{env.NUM_PROCS}} cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}} cmake --build . --target ifw_c_binding -- -j ${{env.NUM_PROCS}} + cmake --build . --target hydrodyn_c_binding -- -j ${{env.NUM_PROCS}} cmake --build . --target regression_test_controllers -- -j ${{env.NUM_PROCS}} - name: Cache the workspace uses: actions/cache@v3.0.4