Continuous integration #306
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous integration | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| pull_request: | |
| branches: [ "master" ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| setup-linux: | |
| runs-on: [self-hosted, Linux, external] | |
| name: Setup - Linux | |
| steps: | |
| - name: Checkout build environment information | |
| uses: actions/checkout@v4 | |
| with: | |
| path: bitpit | |
| sparse-checkout: | | |
| environments | |
| - name: Build environment | |
| shell: bash | |
| run: | | |
| DOCKER_BUILDKIT=1 docker buildx build \ | |
| --builder=container \ | |
| --rm \ | |
| --target bitpit-environment \ | |
| -f bitpit/environments/ubuntu/Dockerfile . | |
| - name: Cleanup build environment information | |
| run: | | |
| rm -rf bitpit | |
| tests-linux: | |
| runs-on: [self-hosted, Linux, external] | |
| needs: setup-linux | |
| name: Linux (${{ matrix.compiler }}) - MPI ${{ matrix.mpi }} - Debug ${{ matrix.debug }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - compiler: gcc | |
| mpi: ON | |
| debug: ON | |
| - compiler: gcc | |
| mpi: ON | |
| debug: OFF | |
| - compiler: gcc | |
| mpi: OFF | |
| debug: ON | |
| - compiler: gcc | |
| mpi: OFF | |
| debug: OFF | |
| - compiler: clang | |
| mpi: ON | |
| debug: OFF | |
| steps: | |
| - name: Checkout bitpit | |
| uses: actions/checkout@v4 | |
| - name: Build bitpit | |
| shell: bash | |
| run: | | |
| DOCKER_BUILDKIT=1 docker buildx build \ | |
| --builder=container \ | |
| --rm \ | |
| --build-arg COMPILER=${{ matrix.compiler }} \ | |
| --build-arg MPI=${{ matrix.mpi }} \ | |
| --build-arg DEBUG=${{ matrix.debug }} \ | |
| --target bitpit-build \ | |
| -f environments/ubuntu/Dockerfile . | |
| - name: Run bitpit tests | |
| shell: bash | |
| run: | | |
| DOCKER_BUILDKIT=1 docker buildx build \ | |
| --builder=container \ | |
| --rm \ | |
| --build-arg COMPILER=${{ matrix.compiler }} \ | |
| --build-arg MPI=${{ matrix.mpi }} \ | |
| --build-arg DEBUG=${{ matrix.debug }} \ | |
| --target bitpit-test \ | |
| -f environments/ubuntu/Dockerfile . | |
| tests-windows: | |
| runs-on: [self-hosted, win11, external] | |
| name: Windows (MSVC) - MPI ${{ matrix.mpi }} - Debug ${{ matrix.debug }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - mpi: OFF | |
| debug: OFF | |
| - mpi: ON | |
| debug: OFF | |
| - mpi: OFF | |
| debug: ON | |
| - mpi: ON | |
| debug: ON | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build bitpit | |
| shell: cmd | |
| run: | | |
| echo OFF | |
| echo Prepare environment | |
| echo preloading build tools variables | |
| call C:\BuildTools\VC\Auxiliary\Build\vcvars64.bat | |
| REM Calling setvars.bat works properly only if called with call statement. | |
| call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" | |
| IF %SETVARS_COMPLETED% == 1 (echo MKL status.......... Loaded) else (echo MKL status.......... Error) | |
| IF "${{ matrix.mpi }}" == "ON" (echo Parallel paradigm... MPI) else (echo Parallel paradigm... Serial) | |
| IF "${{ matrix.debug }}" == "ON" (set "BUILD_TYPE=Debug") ELSE (set "BUILD_TYPE=Release") | |
| echo Build type.......... %BUILD_TYPE% | |
| set "PETSC_DIR=C:\petsc-mpi" | |
| IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=C:\petsc") | |
| echo PETSc directory..... %PETSC_DIR% | |
| set "INSTALL_DIR=%cd%/install" | |
| IF exist %INSTALL_DIR% (rmdir /q /s "%INSTALL_DIR%") | |
| mkdir "%INSTALL_DIR%" | |
| set "BUILD_DIR=%cd%/build" | |
| IF exist "%BUILD_DIR%" (rmdir /q /s "%BUILD_DIR%") | |
| mkdir "%BUILD_DIR%" | |
| echo Enter build directory | |
| cd "%BUILD_DIR%" | |
| echo Configure bitpit | |
| set "CMAKE_VARIABLES=" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBoost_USE_STATIC_LIBS=OFF" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBOOST_ROOT:PATH=C:\optimad-dependencies\boost-v1.80.0\lib\cmake\Boost-1.80.0" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_BUILD_EXAMPLES=ON" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_INTEGRATION_TESTS=ON" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_MPI=${{ matrix.mpi }}" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBITPIT_ENABLE_UNIT_TESTS=ON" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBUILD_SHARED_LIBS=ON" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DBUILD_TESTING=ON" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_BUILD_TYPE=%BUILD_TYPE%" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_CONFIGURATION_TYPES=%BUILD_TYPE%" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_INSTALL_PREFIX=%INSTALL_DIR%" | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON" | |
| IF "${{ matrix.mpi }}" == "ON" (set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DMETIS_DIR=C:\optimad-dependencies\Metis-v5.1.0\") | |
| set "CMAKE_VARIABLES=%CMAKE_VARIABLES% -DPETSC_DIR=%PETSC_DIR%" | |
| cmake.exe -G "Visual Studio 17 2022" %CMAKE_VARIABLES% .. | |
| echo Build bitpit | |
| MSBuild.exe INSTALL.vcxproj /p:Configuration=%BUILD_TYPE% /p:Platform=x64 /m:8 | |
| - name: Run bitpit tests | |
| shell: cmd | |
| if: matrix.debug == 'OFF' | |
| run: | | |
| echo OFF | |
| echo Prepare environment | |
| set "INSTALL_DIR=%cd%/install" | |
| set "BUILD_DIR=%cd%/build" | |
| IF "${{ matrix.debug }}" == "ON" (set "BUILD_TYPE=Debug") ELSE (set "BUILD_TYPE=Release") | |
| echo Build type.......... %BUILD_TYPE% | |
| call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" | |
| set "PATH=%PATH%;C:\optimad-dependencies\boost-v1.80.0\lib" | |
| IF "${{ matrix.mpi }}" == "ON" (set "PATH=%PATH%;C:\optimad-dependencies\Metis-v5.1.0\lib\") | |
| set "PETSC_DIR=C:\petsc-mpi" | |
| IF "${{ matrix.mpi }}" == "OFF" (set "PETSC_DIR=C:\petsc") | |
| set "PATH=%PATH%;%PETSC_DIR%\lib" | |
| set "PATH=%PATH%;%INSTALL_DIR%/bin" | |
| echo Enter build directory | |
| cd "%BUILD_DIR%" | |
| echo Run tests | |
| ctest.exe --output-on-failure -C %BUILD_TYPE% |