Skip to content

Simplify github actions CI yaml file to use stock github runners and latest versions of windows/mac/ubuntu #82

Simplify github actions CI yaml file to use stock github runners and latest versions of windows/mac/ubuntu

Simplify github actions CI yaml file to use stock github runners and latest versions of windows/mac/ubuntu #82

Workflow file for this run

# borrowed this from:
# https://raw.githubusercontent.com/AcademySoftwareFoundation/Imath/main/.github/workflows/ci_workflow.yml
# with some slight simplifications
name: CI
on:
push:
# Jobs are skipped when ONLY Markdown (*.md) files are changed
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
jobs:
# Linux jobs run in Docker containers, so the latest OS version is OK. macOS
# and Windows jobs need to be locked to specific virtual environment
# versions to mitigate issues from OS updates, and will require maintenance
# as OS versions are retired.
#
# GH Actions (Free plan) supports 20 concurrent jobs, with 5 concurrent macOS
# jobs. This workflow tries to utilize (but not exceed) that budget to
# promote timely CI.
# ---------------------------------------------------------------------------
# Linux
# ---------------------------------------------------------------------------
# TODO: Add ARM build. Add sanitize build.
linux:
name: '${{ matrix.os }}
<${{ matrix.compiler-desc }} ,
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
cxx=${{ matrix.cxx-standard }}>'
# GH-hosted VM. The build runs in CentOS 7 'container' defined below.
runs-on: ubuntu-latest
strategy:
matrix:
build: [1, 2, 3, 4]
include:
# -------------------------------------------------------------------
# CLANG, Release
# -------------------------------------------------------------------
- build: 1
build-type: Release
build-shared: 'ON'
cxx-standard: 17
cc_compiler: clang
cxx_compiler: clang++
compiler-desc: clang
os: ubuntu-latest
# -------------------------------------------------------------------
# CLANG, Debug
# -------------------------------------------------------------------
- build: 2
build-type: Debug
build-shared: 'ON'
cxx-standard: 17
cc_compiler: clang
cxx_compiler: clang++
compiler-desc: clang
os: ubuntu-latest
# -------------------------------------------------------------------
# gcc, Release
# -------------------------------------------------------------------
- build: 3
build-type: Release
build-shared: 'ON'
cxx-standard: 17
cxx-compiler: g++
cc-compiler: gcc
compiler-desc: gcc
os: ubuntu-latest
# -------------------------------------------------------------------
# gcc, Debug
# -------------------------------------------------------------------
- build: 4
build-type: Debug
build-shared: 'ON'
cxx-standard: 17
cxx-compiler: g++
cc-compiler: gcc
compiler-desc: gcc
os: ubuntu-latest
env:
CXX: ${{ matrix.cxx-compiler }}
CC: ${{ matrix.cc-compiler }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create build directories
run: |
mkdir _install
mkdir _build
- name: Configure
run: |
cmake .. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }} \
working-directory: _build
- name: Build
run: |
cmake --build . \
--target install \
--config ${{ matrix.build-type }}
working-directory: _build
- name: Test
run: |
ctest --build-config ${{ matrix.build_type }} --verbose
working-directory: _build
# ---------------------------------------------------------------------------
# macOS
# ---------------------------------------------------------------------------
macos_no_python:
name: '${{ matrix.os }}
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
cxx=${{ matrix.cxx-standard }}'
runs-on: macos-latest
strategy:
matrix:
build: [1, 2]
include:
# Release
- build: 1
build-type: Release
build-shared: 'ON'
cxx-standard: 17
os: macos-latest
# Debug
- build: 2
build-type: Debug
build-shared: 'ON'
build-docs: 'OFF'
cxx-standard: 17
os: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create build directories
run: |
mkdir _install
mkdir _build
- name: Configure
run: |
cmake ../. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }}
working-directory: _build
- name: Build
run: |
cmake --build . \
--target install \
--config ${{ matrix.build-type }} \
-- -j2
working-directory: _build
- name: Test
run: |
ctest --build-config ${{ matrix.build_type }} --verbose
working-directory: _build
# ---------------------------------------------------------------------------
# Windows
# ---------------------------------------------------------------------------
windows:
name: '${{ matrix.os }}
<${{ matrix.compiler-desc }},
config=${{ matrix.build-type }},
shared=${{ matrix.build-shared }},
cxx=${{ matrix.cxx-standard }}'
runs-on: windows-latest
strategy:
matrix:
build: [1, 2]
include:
- build: 1
build-type: Release
build-shared: 'ON'
compiler-desc: msvc16.11
cxx-standard: 17
- build: 2
build-type: Debug
build-shared: 'ON'
compiler-desc: msvc16.11
cxx-standard: 17
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create build directories
run: |
mkdir _install
mkdir _build
shell: bash
- name: Configure
# the windows build needs the -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS to work
run: |
cmake ../. \
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS='ON'\
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cxx-standard }} \
-DCMAKE_CXX_FLAGS=${{ matrix.cxx-flags }} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL='OFF' \
-DBUILD_SHARED_LIBS=${{ matrix.build-shared }}
shell: bash
working-directory: _build
- name: Build
run: |
cmake --build . \
--target install \
--config ${{ matrix.build-type }}
shell: bash
working-directory: _build
- name: Test
run: |
ctest -C ${{ matrix.build-type }}
shell: bash
working-directory: _build