Completely Rebuild our CI System #4
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 | |
on: | |
push: | |
branches: [ develop ] | |
tags: | |
- 'v*' # Push events matching v*, i.e. v1.0, v20.15.10 | |
pull_request: | |
branches: [ develop ] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
FC: gfortran-13 | |
Python_REQUIRED_VERSION: 3.12.2 | |
shell: bash | |
jobs: | |
build_and_test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: macos-12 | |
macos_dev_target: 12.1 | |
arch: x86_64 | |
python-arch: x64 | |
generator: "Unix Makefiles" | |
nproc: 3 | |
targets: energyplus ExpandObjects ReadVarsESO Slab Basement AppGPostProcess ParametricPreprocessor | |
- os: macos-14 | |
macos_dev_target: 13.0 | |
arch: arm64 | |
python-arch: arm64 | |
generator: "Unix Makefiles" | |
nproc: 3 | |
targets: energyplus ExpandObjects ReadVarsESO Slab Basement AppGPostProcess ParametricPreprocessor | |
- os: ubuntu-24.04 | |
arch: x86_64 | |
python-arch: x64 | |
generator: "Unix Makefiles" | |
nproc: 4 | |
targets: energyplus ExpandObjects ReadVarsESO Slab Basement AppGPostProcess ParametricPreprocessor | |
- os: windows-2019 | |
arch: x86_64 | |
python-arch: x64 | |
generator: "Visual Studio 16 2019" | |
nproc: 4 | |
targets: energyplus ExpandObjects_build ReadVars_build Slab_build Basement_build AppGPostProcess_build ParametricPreprocessor_build | |
- os: windows-2022 | |
arch: x86_64 | |
python-arch: x64 | |
generator: "Visual Studio 17 2022" | |
nproc: 4 | |
targets: energyplus ExpandObjects_build ReadVars_build Slab_build Basement_build AppGPostProcess_build ParametricPreprocessor_build | |
steps: | |
- name: Set up Python ${{ env.Python_REQUIRED_VERSION }} | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.Python_REQUIRED_VERSION }} | |
- name: Install Dependencies for Mac | |
if: ${{ runner.os == 'macOS' }} | |
run: | | |
brew update | |
brew install gcc@13 | |
echo "FC=$(brew --prefix gcc@13)/bin/gfortran-13" >> $GITHUB_ENV | |
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_dev_target }} >> $GITHUB_ENV | |
- name: Install Dependencies for Linux | |
if: ${{ runner.os == 'Linux' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install libxkbcommon-x11-0 xorg-dev libgl1-mesa-dev | |
if [[ "${{ matrix.os }}" == "ubuntu-24.04" ]]; then | |
# https://github.com/actions/runner-images/issues/10025 | |
echo "FC=gfortran-13" >> $GITHUB_ENV | |
fi | |
# - name: Install Dependencies for Windows | |
# if: ${{ runner.os == 'Windows' }} | |
# run: choco install cmake --version=3.28.4 --installargs 'ADD_CMAKE_TO_PATH=System' | |
# BUILD AND TEST INTEGRATION FILES ON THE BASELINE BRANCH | |
- name: Baseline Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: develop | |
path: baseline | |
- name: Baseline Create Build Directory | |
run: cmake -E make_directory ./baseline/build/ | |
- name: Baseline Configure CMake | |
working-directory: ./baseline/build | |
run: > | |
cmake | |
-G "${{ matrix.generator }}" | |
-DCMAKE_BUILD_TYPE:STRING=Release | |
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${{ matrix.macos_dev_target }} | |
-DLINK_WITH_PYTHON:BOOL=ON | |
-DPython_REQUIRED_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} | |
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ matrix.python-arch }}/ | |
-DBUILD_TESTING:BOOL=ON | |
-DBUILD_FORTRAN:BOOL=ON | |
-DBUILD_PACKAGE:BOOL=OFF | |
-DDOCUMENTATION_BUILD:STRING=DoNotBuild | |
-DENABLE_OPENMP:BOOL=OFF | |
-DUSE_OpenMP:BOOL=OFF | |
../ | |
- name: Baseline Build | |
working-directory: ./baseline/build | |
# Building specific target list so that we don't waste time building the unit test binary | |
run: cmake --build . -j ${{ matrix.nproc }} --config Release --target ${{ matrix.targets }} | |
- name: Baseline Test | |
working-directory: ./baseline/build | |
run: ctest -C Release -E Basement -R integration -j 3 # TODO: Speed up basement so we don't have to skip it. | |
# BUILD AND TEST EVERYTHING ON THE CURRENT BRANCH | |
- name: Branch Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: branch | |
- name: Branch Create Build Directory | |
run: cmake -E make_directory ./branch/build/ | |
- name: Branch Configure CMake | |
working-directory: ./branch/build | |
run: > | |
cmake | |
-G "${{ matrix.generator }}" | |
-DCMAKE_BUILD_TYPE:STRING=Release | |
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${{ matrix.macos_dev_target }} | |
-DLINK_WITH_PYTHON:BOOL=ON | |
-DPython_REQUIRED_VERSION:STRING=${{ steps.setup-python.outputs.python-version }} | |
-DPython_ROOT_DIR:PATH=$RUNNER_TOOL_CACHE/Python/${{ steps.setup-python.outputs.python-version }}/${{ matrix.python-arch }}/ | |
-DBUILD_TESTING:BOOL=ON | |
-DBUILD_FORTRAN:BOOL=ON | |
-DBUILD_PACKAGE:BOOL=OFF | |
-DDOCUMENTATION_BUILD:STRING=DoNotBuild | |
-DENABLE_OPENMP:BOOL=OFF | |
-DUSE_OpenMP:BOOL=OFF | |
../ | |
- name: Branch Build | |
working-directory: ./branch/build | |
run: cmake --build . -j ${{ matrix.nproc }} --config Release | |
- name: Branch Test | |
working-directory: ./branch/build | |
run: ctest -C Release -E Basement -j 3 | |
continue-on-error: true # allow unit tests to fail but still try to run regressions next | |
- name: Install Regression Tool | |
run: pip install energyplus-regressions # TODO: Not sure if we need to use a different python path here, and we could pip it or clone it | |
- name: Run Regressions | |
run: python ./branch/scripts/dev/gha_regressions.py ./baseline/build/testfiles ./branch/build/testfiles/ |