Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions Rework #579

Merged
merged 5 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/cmake-config/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Configure CMake'
description: 'Configure the CMake project'
author: 'Rafael Mudafort https://github.com/rafmudaf'

inputs:
build-type:
description: 'Set the CMake build type: Release (-O3); RelWithDebInfo (-O2 -g); Debug (-g)'
default: 'Release'
additional-flags:
description: 'Additional flags to pass directly to the CMake command'
default: ''

runs:
using: 'composite'
steps:
- run: cmake .. -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} ${{ inputs.additional-flags }}
working-directory: "/openfast/build"
shell: bash
24 changes: 0 additions & 24 deletions .github/actions/compile-and-test/Dockerfile

This file was deleted.

10 changes: 0 additions & 10 deletions .github/actions/compile-and-test/action.yml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/actions/compile-and-test/entrypoint.sh

This file was deleted.

15 changes: 15 additions & 0 deletions .github/actions/compile/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Compile OpenFAST'
description: 'Compile part or all of OpenFAST'
author: 'Rafael Mudafort https://github.com/rafmudaf'

inputs:
build-target:
description: 'Which targets to compile'
default: 'install'

runs:
using: 'composite'
steps:
- run: make -j4 ${{ inputs.build-target }}
working-directory: "/openfast/build"
shell: bash
22 changes: 22 additions & 0 deletions .github/actions/git-update/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Update the existin OpenFAST project in the Docker image'
description: 'Workaround to avoid recompiling every component since the Docker image has the latest "dev" branch precompiled.'
author: 'Rafael Mudafort https://github.com/rafmudaf'

inputs:
repository:
description: 'The GitHub repository that is taking action.'
required: true
ref:
description: 'The branch or tag ref that triggered the action.'
required: true

runs:
using: 'composite'
steps:
- run: |
git config --global user.email "openfast@github_actions.ci"
git config --global user.name "OpenFAST Continuous Integration"
git pull --no-verify https://github.com/${{ inputs.repository }} ${{ inputs.ref }}
git submodule update
working-directory: "/openfast/"
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/tests-gluecode-openfast/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'OpenFAST glue code tests'
description: 'Run tests focused on the OpenFAST glue code'
author: 'Rafael Mudafort https://github.com/rafmudaf'
runs:
using: 'composite'
steps:
- 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: "/openfast/build"
shell: bash

# OpenFAST linearization tests
# Dont run these in parallel, copying the case files can fail in a race condition
# Exclude the Ideal_Beam test cases
# - They fail consistently in the Docker container when run on GitHub,
# but pass everywhere else including running the same Docker image locally

# Subset of OpenFAST regression tests; do not run
# - 9, 16 because they're very sensitive
# - 19, 20 because they're too long
9 changes: 9 additions & 0 deletions .github/actions/tests-module-aerodyn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'AeroDyn module tests'
description: 'Run tests specific to the AeroDyn module'
author: 'Rafael Mudafort https://github.com/rafmudaf'
runs:
using: "composite"
steps:
- run: ctest -VV -R fvw_utest
working-directory: "/openfast/build"
shell: bash
11 changes: 11 additions & 0 deletions .github/actions/tests-module-beamdyn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'BeamDyn module tests'
description: 'Run tests specific to the BeamDyn module'
author: 'Rafael Mudafort https://github.com/rafmudaf'
runs:
using: "composite"
steps:
- run: |
ctest -VV -j7 -R bd_
ctest -VV -R beamdyn_utest
working-directory: "/openfast/build"
shell: bash
9 changes: 9 additions & 0 deletions .github/actions/tests-module-hydrodyn/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'HydroDyn module tests'
description: 'Run tests specific to the HydroDyn module'
author: 'Rafael Mudafort https://github.com/rafmudaf'
runs:
using: "composite"
steps:
- run: ctest -VV -j7 -hd_
working-directory: "/openfast/build"
shell: bash
9 changes: 9 additions & 0 deletions .github/actions/tests-module-nwtclibrary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'NWTC Library module tests'
description: 'Run tests specific to the NWTC Library module'
author: 'Rafael Mudafort https://github.com/rafmudaf'
runs:
using: "composite"
steps:
- run: ctest -VV -R nwtc_library_utest
working-directory: "/openfast/build"
shell: bash
79 changes: 79 additions & 0 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@

name: 'Development Pipeline'

on:
push:

pull_request:
types: [opened, labeled] #, assigned]

# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [macOS-10.14, ubuntu-18.04]

jobs:
build-and-test:

# Do not run if:
# - Branch name contains "docs/"
if: "!contains(github.ref, 'docs/')"

runs-on: ubuntu-latest
container:
image: rafmudaf/openfast-ubuntu:dev
steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: recursive
- name: Git Update
uses: ./.github/actions/git-update
with:
repository: $GITHUB_REPOSITORY
ref: $GITHUB_REF

- name: Configure CMake
uses: ./.github/actions/cmake-config
with:
build-type: RelWithDebInfo
additional-flags: -DBUILD_TESTING=ON -DCTEST_PLOT_ERRORS=ON

- name: Compile Unit Tests
uses: ./.github/actions/compile
with:
build-target: 'unit_tests'
- name: Compile Drivers
uses: ./.github/actions/compile
with:
build-target: 'beamdyn_driver hydrodyn_driver'
- name: Compile OpenFAST
# if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All')
uses: ./.github/actions/compile
with:
build-target: 'install'

- name: 'Run NWTC Library tests'
uses: ./.github/actions/tests-module-nwtclibrary
- name: 'Run AeroDyn tests'
uses: ./.github/actions/tests-module-aerodyn
- name: 'Run BeamDyn tests'
uses: ./.github/actions/tests-module-beamdyn
- 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: 'If failure, post test files'
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-results
path: |
build/reg_tests/modules
build/reg_tests/glue-codes/openfast
!build/reg_tests/glue-codes/openfast/5MW_Baseline
!build/reg_tests/glue-codes/openfast/AOC
!build/reg_tests/glue-codes/openfast/AWT27
!build/reg_tests/glue-codes/openfast/SWRT
!build/reg_tests/glue-codes/openfast/UAE_VI
!build/reg_tests/glue-codes/openfast/WP_Baseline
22 changes: 0 additions & 22 deletions .github/workflows/continuous-integration-workflow.yml

This file was deleted.

23 changes: 23 additions & 0 deletions reg_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,26 @@ endforeach()

# add the tests
include(${CMAKE_CURRENT_LIST_DIR}/CTestList.cmake)

set(src "${CMAKE_CURRENT_LIST_DIR}/r-test/glue-codes/openfast/5MW_Baseline/ServoData")
set(dest "${CTEST_BINARY_DIR}/glue-codes/openfast/5MW_Baseline/ServoData/")
add_custom_command(
OUTPUT "${dest}/DISCON.dll"
DEPENDS DISCON
COMMAND "${CMAKE_COMMAND}" -E copy "${src}/DISCON/build/DISCON.dll" "${dest}"
)
add_custom_command(
OUTPUT "${dest}/DISCON_ITIBarge.dll"
DEPENDS DISCON_ITIBarge
COMMAND "${CMAKE_COMMAND}" -E copy "${src}/DISCON_ITI/build/DISCON_ITIBarge.dll" "${dest}"
)
add_custom_command(
OUTPUT "${dest}/DISCON_OC3Hywind.dll"
DEPENDS DISCON_OC3Hywind
COMMAND "${CMAKE_COMMAND}" -E copy "${src}/DISCON_OC3/build/DISCON_OC3Hywind.dll" "${dest}"
)

add_custom_target(
regression_tests
DEPENDS openfast "${dest}/DISCON.dll" "${dest}/DISCON_ITIBarge.dll" "${dest}/DISCON_OC3Hywind.dll"
)
30 changes: 7 additions & 23 deletions share/docker/openfast_dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,16 @@
# limitations under the License.
#

FROM rafmudaf/openfast-ubuntu:dev
FROM rafmudaf/openfast-ubuntu:v2.3.0

# Move into the openfast directory and update
WORKDIR /openfast
RUN git fetch
RUN git pull
RUN git submodule update
RUN git fetch && \
git checkout -b dev origin/dev && \
git submodule update

# Move into the "build" directory, remove the old reg tests, and compile
WORKDIR /openfast/build
RUN rm -rf reg_tests
RUN cmake ..
RUN make -j4 install

# Run the tests

# BeamDyn-specific tests
RUN ctest -VV -j7 -R bd_
RUN ctest -VV -R beamdyn_utest

# OpenFAST linearization tests
# Dont run these in parallel, copying the case files can fail in a race condition
RUN ctest -VV -L linear

# Subset of OpenFAST regression tests; do not run
## - 9, 16 because they're very sensitive
## - 19, 20 because theyre too long
## - 17, 22, 23 becuase we dont know why they fail :(
RUN ctest -VV -j8 -I 1,1,1,2,3,4,5,6,7,8,10,11,12,13,14,15,18,21,24,25,27,28,29
RUN rm -rf reg_tests && \
cmake .. && \
make -j4 install
Loading