Issue 94 #59
Workflow file for this run
This file contains 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: Build and Test Matrix | |
on: [pull_request] | |
env: | |
WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18497/w_BaseKit_p_2022.1.2.154_offline.exe | |
WINDOWS_HPCKIT_LATEST_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/18529/w_HPCKit_p_2022.1.2.116_offline.exe | |
WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/irc_nas/17392/w_HPCKit_p_2021.1.0.2682_offline.exe | |
WINDOWS_DPCPP_COMPONENTS: intel.oneapi.win.dpcpp-compiler | |
WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler | |
SAMPLES_TAG: 2022.1.0 | |
jobs: | |
pipeline: | |
name: ${{ matrix.config.name }} | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- { | |
name: "Windows 2019 MSVC", | |
build_type: "Release", | |
os: windows-2019, | |
} | |
- { | |
name: "Ubuntu 20.04", | |
build_type: "Release", | |
os: ubuntu-20.04, | |
} | |
- { | |
name: "Ubuntu 20.04 with SuperLU", | |
build_type: "Release", | |
super_lu: true, | |
os: ubuntu-20.04, | |
} | |
- { | |
name: "macOS Big Sur 11", | |
build_type: "Release", | |
os: macos-11, | |
} | |
steps: | |
# Useful for debugging dll load issues. | |
# - name: Download Dependencies | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# run: | | |
# curl -L https://github.com/lucasg/Dependencies/releases/download/v1.11.1/Dependencies_x64_Release.zip -O | |
# ls | |
# unzip Dependencies_x64_Release.zip | |
# - name: Run Dependencies | |
# if: runner.os == 'Windows' | |
# shell: cmd | |
# run: | | |
# python -VV | |
# Dependencies.exe -depth 2 -chain "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Redist/MSVC/14.29.30133/x64/Microsoft.VC142.CRT/vcruntime140.dll" | |
# This is not needed, we can just install the Fortran compiler for the HPC kit. | |
# - name: Install oneAPI base kit | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# run: oneapi/scripts/install_windows.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_COMPONENTS | |
# - name: Build oneAPI base kit | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# run: oneapi/scripts/build_windows.bat dpc++ "" $SAMPLES_TAG | |
# - name: Checkout oneAPI scripts | |
# if: runner.os == 'Windows' | |
# uses: actions/checkout@v3 | |
# with: | |
# repository: 'hsorby/oneapi-ci' | |
# path: 'oneapi' | |
# Caching doesn't work with Visual Studio integration on. | |
# - name: Cache install oneAPI | |
# if: runner.os == 'Windows' | |
# id: cache-install | |
# uses: actions/cache@v2 | |
# with: | |
# path: C:\Program Files (x86)\Intel\oneAPI\compiler | |
# key: install-${{ env.WINDOWS_HPCKIT_URL }}-${{ env.WINDOWS_FORTRAN_COMPONENTS }}-compiler-${{ hashFiles('**/oneapi/scripts/cache_exclude_windows.sh') }} | |
- name: Install oneAPI HPC kit | |
if: runner.os == 'Windows' | |
uses: hsorby/install-intelfortran-action@main | |
with: | |
cache: false | |
# working-directory: oneapi | |
# shell: bash | |
# run: | | |
# scripts/install_windows.bat $WINDOWS_HPCKIT_URL $WINDOWS_FORTRAN_COMPONENTS | |
# Delete the following if you don't want to save install logs | |
# - name: Saving install logs | |
# if: runner.os == 'Windows' && steps.cache-install.outputs.cache-hit != 'true' | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: InstallLogs_${{ github.job }} | |
# path: | | |
# oneapi/bootstrapper* | |
# oneapi/installer* | |
# retention-days: 7 | |
# Add in for building a simple Fortran application to test the Fortran compiler is working. | |
# - name: Build oneAPI HPC kit | |
# if: runner.os == 'Windows' | |
# shell: bash | |
# run: oneapi/scripts/build_windows.bat fortran "" $SAMPLES_TAG | |
# - name: Exclude unused files from cache | |
# if: runner.os == 'Windows' && steps.cache-install.outputs.cache-hit != 'true' | |
# working-directory: oneapi | |
# run: scripts/cache_exclude_windows.ps1 | |
- name: Checkout lungsim | |
uses: actions/checkout@v3 | |
with: | |
path: lungsim | |
- name: Run get Fortran environment script | |
id: setup-fortran-win | |
if: runner.os == 'WindowsX' | |
shell: bash | |
working-directory: lungsim | |
run: | | |
latest_version=`.github/scripts/oneapi-env-vars-location.bat` | |
echo "ifort compiler: $latest_version" | |
# latest_version=`echo $latest_version | tr '\' '/'` | |
# echo $latest_version | |
# echo "::set-output name=env_bat::${latest_version}" | |
echo "fc=${latest_version}" >> $GITHUB_OUTPUT | |
redist_location=`.github/scripts/oneapi-redist-location.bat` | |
echo "redist location: ${redist_location}" | |
echo "redist_loc=${redist_location}" >> $GITHUB_OUTPUT | |
- name: Report CMake version | |
run: cmake --version | |
- name: Install SuperLU | |
if: matrix.config.super_lu | |
shell: bash | |
run: sudo apt-get install libsuperlu-dev | |
- name: Create virtual environment | |
shell: cmake -P {0} | |
id: create-venv | |
run: | | |
if ("${{ runner.os }}" STREQUAL "Windows") | |
set(SYS_PYTHON_EXE python) | |
else() | |
set(SYS_PYTHON_EXE python3) | |
endif() | |
execute_process( | |
COMMAND ${SYS_PYTHON_EXE} -m venv venv | |
RESULT_VARIABLE result | |
) | |
if (NOT result EQUAL 0) | |
message(FATAL_ERROR "Failed to create virtual environment.") | |
endif() | |
if ("${{ runner.os }}" STREQUAL "Windows") | |
file(GLOB PYTHON_EXE venv/Scripts/python.exe) | |
file(GLOB PIP_EXE venv/Scripts/pip.exe) | |
else() | |
file(GLOB PYTHON_EXE venv/bin/python) | |
file(GLOB PIP_EXE venv/bin/pip) | |
endif() | |
execute_process( | |
COMMAND ${PYTHON_EXE} -m pip install numpy | |
RESULT_VARIABLE result | |
) | |
if (NOT result EQUAL 0) | |
message(FATAL_ERROR "Failed to install numpy to virtual environment.") | |
endif() | |
file(APPEND $ENV{GITHUB_OUTPUT} "python_exe=${PYTHON_EXE}\n") | |
file(APPEND $ENV{GITHUB_OUTPUT} "pip_exe=${PIP_EXE}\n") | |
- name: Generate build instructions - Windows | |
shell: cmd | |
if: runner.os == 'Windows' | |
run: | | |
cmake -S lungsim -B build-lungsim -D CMAKE_Fortran_COMPILER="%INTEL_COMPILER_BIN_PATH:\=/%/ifort.exe" -D AETHER_ENABLE_TESTS=FALSE -D Python_EXECUTABLE=${{ steps.create-venv.outputs.python_exe }} | |
- name: Generate build instructions - Linux | |
shell: bash | |
if: runner.os == 'Linux' | |
run: | | |
cmake \ | |
-S lungsim \ | |
-B build-lungsim \ | |
-D CMAKE_Fortran_COMPILER=gfortran \ | |
-D AETHER_ENABLE_TESTS=FALSE \ | |
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ | |
-D Python_EXECUTABLE=${{ steps.create-venv.outputs.python_exe }} | |
- name: Generate build instructions - macOS | |
shell: bash | |
if: runner.os == 'macOS' | |
run: | | |
cmake \ | |
-S lungsim \ | |
-B build-lungsim \ | |
-D CMAKE_Fortran_COMPILER=gfortran-10 \ | |
-D AETHER_ENABLE_TESTS=FALSE \ | |
-D CMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \ | |
-D Python_EXECUTABLE=${{ steps.create-venv.outputs.python_exe }} | |
- name: Build lungsim | |
shell: cmake -P {0} | |
run: | | |
if ("${{ runner.os }}" STREQUAL "Windows") | |
set(WINDOWS_BUILD_CONFIG --config ${{ matrix.config.build_type }}) | |
endif() | |
execute_process( | |
COMMAND cmake --build build-lungsim ${WINDOWS_BUILD_CONFIG} | |
RESULT_VARIABLE result | |
OUTPUT_VARIABLE output | |
ERROR_VARIABLE output | |
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE | |
) | |
if (NOT result EQUAL 0) | |
string(REGEX MATCH "FAILED:.*$" error_message "${output}") | |
string(REPLACE "\n" "%0A" error_message "${error_message}") | |
message("::error::${error_message}") | |
message(FATAL_ERROR "Build failed.") | |
endif() | |
- name: Test lungsim | |
shell: bash | |
run: | | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
multi_config_dir=/${{ matrix.config.build_type }} | |
fi | |
${{ steps.create-venv.outputs.pip_exe }} install wheel | |
${{ steps.create-venv.outputs.pip_exe }} install $GITHUB_WORKSPACE/build-lungsim/src/bindings/python$multi_config_dir | |
if [ "${{ runner.os }}" == "Windows" ]; then | |
# Horrible hack for GitHub actions Windows virtual machine. | |
prefix_path=$(dirname $(dirname ${{ steps.create-venv.outputs.python_exe }})) | |
cp $prefix_path/Library/bin/libifcoremd.dll $GITHUB_WORKSPACE/venv/Lib/site-packages/aether | |
cp $prefix_path/Library/bin/libmmd.dll $GITHUB_WORKSPACE/venv/Lib/site-packages/aether | |
cp $prefix_path/Library/bin/svml_dispmd.dll $GITHUB_WORKSPACE/venv/Lib/site-packages/aether | |
fi | |
${{ steps.create-venv.outputs.python_exe }} $GITHUB_WORKSPACE/lungsim/.github/scripts/diagnostics_test.py | |
exit $? |