Skip to content

Triplet build

Triplet build #32

# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: Build and Test MSX
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build, Unit Testing, and Regression Testing
environment: testing
env:
BuildVersion: 2.0.0
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
include:
- os: windows-latest
cmake_generator: -G "Visual Studio 17 2022" -A "x64"
continue-on-error: false
alias: win64
assign_permission:
- os: ubuntu-latest
cmake_generator: -G "Unix Makefiles"
continue-on-error: false
alias: Linux
assign_permission: chmod u+x ./build/_CPack_Packages/${{ matrix.alias }}/TGZ/EPANETMSX-${{ env.BuildVersion }}-${{ matrix.alias }}/bin/runepanetmsx

Check failure on line 30 in .github/workflows/build-and-test.yml

View workflow run for this annotation

GitHub Actions / Build and Test MSX

Invalid workflow file

The workflow is not valid. .github/workflows/build-and-test.yml (Line: 30, Col: 32): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.alias .github/workflows/build-and-test.yml (Line: 35, Col: 32): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.alias
- os: macos-latest
cmake_generator: -G "Xcode"
continue-on-error: false
alias: Darwin
assign_permission: chmod u+x ./build/_CPack_Packages/${{ matrix.alias }}/TGZ/EPANETMSX-${{ env.BuildVersion }}-${{ matrix.alias }}/bin/runepanetmsx
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.continue-on-error }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true
- name: Build OpenMP Binaries for MacOS via Homebrew
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew reinstall --build-from-source --formula ./shell/apple/libomp.rb
- name: Build
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only
# required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
cmake -B .\build ${{ matrix.cmake_generator }} .
cmake --build .\build --config Release --target package
- name: Run Example
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only
# required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: |
${{ matrix.assign_permission }}
./build/_CPack_Packages/${{ matrix.alias }}/ZIP/EPANETMSX-${{ env.BuildVersion }}-${{ matrix.alias }}/bin/runepanetmsx ./examples/example.inp ./examples/example.msx ./examples/example.rpt ./examples/example.out
- name: Upload artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: build-test-artifacts
path: |
build/*.zip
build/*.tar.gz