diff --git a/.github/actions/compile-and-test/Dockerfile b/.github/actions/compile-and-test/Dockerfile new file mode 100644 index 0000000000..cd47424a4b --- /dev/null +++ b/.github/actions/compile-and-test/Dockerfile @@ -0,0 +1,43 @@ +# +# Copyright 2016 National Renewable Energy Laboratory +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM rafmudaf/openfast-ubuntu:dev + +# Move into the openfast directory and update +WORKDIR /openfast +RUN git fetch +RUN git pull +RUN git submodule update + +# Move into the "build" directory and compile +WORKDIR /openfast/build +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 +RUN ctest -VV -j4 -L linear + +# Subset of OpenFAST regression tests; do not run +## - 3, 4, 7, 14, 15, 16, since the free yaw is not well trusted +## - 9 because its super sensitive +## - 19, 20 because theyre too long +RUN ctest -VV -j8 -I 1,1,1,2,5,6,8,10,11,12,13,17,18,21,22,23,24,25 diff --git a/.github/actions/compile-and-test/action.yml b/.github/actions/compile-and-test/action.yml new file mode 100644 index 0000000000..572382f438 --- /dev/null +++ b/.github/actions/compile-and-test/action.yml @@ -0,0 +1,10 @@ +name: 'Compile and test' +description: 'Compile OpenFAST and run the tests' +author: 'NREL' +# inputs: +# build-type: +# description: 'Set the CMake build type: Release (-O3); RelWithDebInfo (-O2 -g); Debug (-g)' +# default: 'Release' +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml new file mode 100644 index 0000000000..6f093809e2 --- /dev/null +++ b/.github/workflows/continuous-integration-workflow.yml @@ -0,0 +1,25 @@ + +name: OpenFAST Build and Test + +# on: +# push: +# branches: +# - testing/github_actions + +# runs-on: ${{ matrix.os }} +# strategy: +# matrix: +# os: [macOS-10.14, ubuntu-18.04] +# runs-on: docker://rafmudaf/openfast-ubuntu:alpha + +jobs: + build-and-test: + runs-on: ubuntu-latest + name: OpenFAST tests on Ubuntu + steps: + - name: Checkout + uses: actions/checkout@master + with: + submodule: recursive + - name: Build and test step + uses: ./.github/actions/compile-and-test diff --git a/share/docker/openfast_dev/Dockerfile b/share/docker/openfast_dev/Dockerfile new file mode 100644 index 0000000000..1983e827c3 --- /dev/null +++ b/share/docker/openfast_dev/Dockerfile @@ -0,0 +1,43 @@ +# +# Copyright 2016 National Renewable Energy Laboratory +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM rafmudaf/openfast-ubuntu:dev + +# Move into the openfast directory and update +WORKDIR /openfast +RUN git fetch +RUN git pull +RUN git submodule update + +# Move into the "build" directory and compile +WORKDIR /openfast/build +RUN cmake .. +RUN make -j4 install + +# Run the tests + +# BeamDyn-specific tests +RUN ctest -VV -j7 bd_ +RUN ctest -VV beamdyn_utest + +# OpenFAST linearization tests +RUN ctest -VV -j4 -L linear + +# Subset of OpenFAST regression tests; do not run +## - 3, 4, 7, 14, 15, 16, since the free yaw is not well trusted +## - 9 because its super sensitive +## - 19, 20 because theyre too long +RUN ctest -VV -j8 -I 1,1,1,2,5,6,8,10,11,12,13,17,18,21,22,23,24,25 diff --git a/share/docker/openfast_ubuntu/Dockerfile b/share/docker/openfast_ubuntu/Dockerfile new file mode 100644 index 0000000000..9ff0d095cb --- /dev/null +++ b/share/docker/openfast_ubuntu/Dockerfile @@ -0,0 +1,51 @@ +# +# Copyright 2016 National Renewable Energy Laboratory +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +FROM ubuntu:latest + +# Install dependencies + +# For gfortran-8 +# RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y +# apt-get install gfortran-8 + +RUN apt update -qq +RUN apt install -y software-properties-common build-essential +RUN apt install -y python3-pip +RUN apt install -y cmake cmake-curses-gui +RUN apt install -y gcc gfortran make +RUN apt install -y libblas-dev liblapack-dev +RUN apt install -y git +RUN apt install -y nano +RUN pip3 install numpy + +# Configure the environment +ENV FC=/usr/bin/gfortran + +# Clone the project +RUN git clone --recursive https://github.com/openfast/openfast.git openfast +WORKDIR /openfast +RUN git checkout -b dev origin/dev + +# Build the project +RUN mkdir build +WORKDIR /openfast/build + +# NOTE: building with optimizations on (RELEASE or RELWITHDEBINFO), the virtual machine +# will require about 6GB of memoery. Otherwise, the gfortran compiler will exit with an +# "internal error" +RUN cmake .. -DBUILD_TESTING=ON -DDOUBLE_PRECISION=ON -DCMAKE_BUILD_TYPE=DEBUG +RUN make -j4 install