Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions .github/workflows/build-matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: 🔢 Build Matrix

on:
workflow_call:
workflow_dispatch:

jobs:
build-matrix:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- identifier: windows-debug
os: windows-latest
name: 🏁 Windows Debug
target: template_debug
platform: windows
arch: x86_64
test-bin-suffix: .md.exe

- identifier: windows-release
os: windows-latest
name: 🏁 Windows Release
target: template_release
platform: windows
arch: x86_64
test-bin-suffix: .md.exe

- identifier: macos-debug
os: macos-latest
name: 🍎 macOS (universal) Debug
target: template_debug
platform: macos
arch: universal

- identifier: macos-release
os: macos-latest
name: 🍎 macOS (universal) Release
target: template_release
platform: macos
arch: universal

- identifier: linux-debug
os: ubuntu-22.04
name: 🐧 Linux Debug
target: template_debug
platform: linux
arch: x86_64

- identifier: linux-release
os: ubuntu-22.04
name: 🐧 Linux Release
target: template_release
platform: linux
arch: x86_64

steps:
- name: Checkout project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false

- name: Build
uses: ./.github/actions/openvic-sim-build
with:
identifier: ${{ matrix.identifier }}
target: ${{ matrix.target }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}

- name: Run tests
run: |
./tests/bin/openvic-simulation.tests.${{ matrix.platform }}.${{ matrix.target }}.${{ matrix.arch }}${{ matrix.test-bin-suffix || '' }}
118 changes: 16 additions & 102 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,7 @@ name: 🖥️ Builds
on:
push:
branches: ['master']
paths:
- '.github/workflows/builds.yml'
- '.github/actions/openvic-sim-build/action.yml'
- '**/{SConstruct,SCsub,*.py}'
- '**/*.{hpp,cpp,inc}'
- 'scripts'
- 'deps/**'
- 'tests/**'
- 'AUTHORS.md'
- 'COPYRIGHT'
- 'LICENSE.md'
- '.pre-commit-config.yaml'
- 'pyproject.toml'
- '.clang-format'
- '.clang-tidy'
- '.gitmodules'
pull_request:
paths:
- '.github/workflows/builds.yml'
- '.github/actions/openvic-sim-build/action.yml'
- '**/{SConstruct,SCsub,*.py}'
- '**/*.{hpp,cpp,inc}'
- 'scripts'
- 'deps/**'
- 'tests/**'
- 'AUTHORS.md'
- 'COPYRIGHT'
- 'LICENSE.md'
- '.pre-commit-config.yaml'
- 'pyproject.toml'
- '.clang-format'
- '.clang-tidy'
- '.gitmodules'
merge_group:
workflow_dispatch:

Expand All @@ -47,7 +15,7 @@ permissions: {}

jobs:
static-checks-builds:
name: Code style, file formatting, and docs
name: 📊 Code style, file formatting, and docs
runs-on: ubuntu-latest
if: github.run_attempt > 1 || github.event_name == 'workflow_dispatch' || !vars.DISABLE_BUILDS
outputs:
Expand Down Expand Up @@ -83,78 +51,12 @@ jobs:
extra-args: --files ${{ env.CHANGED_FILES }}

build-master:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
name: 🛠️ Build
needs: static-checks-builds
if: needs.static-checks-builds.outputs.sources-changed == 'true' || github.event_name != 'pull_request'
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- identifier: windows-debug
os: windows-latest
name: 🏁 Windows Debug
target: template_debug
platform: windows
arch: x86_64
test-bin-suffix: .md.exe

- identifier: windows-release
os: windows-latest
name: 🏁 Windows Release
target: template_release
platform: windows
arch: x86_64
test-bin-suffix: .md.exe

- identifier: macos-debug
os: macos-latest
name: 🍎 macOS (universal) Debug
target: template_debug
platform: macos
arch: universal

- identifier: macos-release
os: macos-latest
name: 🍎 macOS (universal) Release
target: template_release
platform: macos
arch: universal

- identifier: linux-debug
os: ubuntu-22.04
name: 🐧 Linux Debug
target: template_debug
platform: linux
arch: x86_64

- identifier: linux-release
os: ubuntu-22.04
name: 🐧 Linux Release
target: template_release
platform: linux
arch: x86_64

steps:
- name: Checkout project
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false

- name: Build
uses: ./.github/actions/openvic-sim-build
with:
identifier: ${{ matrix.identifier }}
target: ${{ matrix.target }}
platform: ${{ matrix.platform }}
arch: ${{ matrix.arch }}

- name: Run tests
run: |
./tests/bin/openvic-simulation.tests.${{ matrix.platform }}.${{ matrix.target }}.${{ matrix.arch }}${{ matrix.test-bin-suffix || '' }}
uses: ./.github/workflows/build-matrix.yml

merge-library-files:
name: 📚 Merge Library Files
Expand All @@ -166,4 +68,16 @@ jobs:
with:
delete-merged: true
name: ${{ github.event.repository.name }}-library
pattern: ${{ github.event.repository.name }}-*-library
pattern: ${{ github.event.repository.name }}-*-library

validate-master:
name: ✅ Validate Success
if: always()
needs: [static-checks-builds, build-master, merge-library-files]
runs-on: Ubuntu-latest
steps:
- name: Check
uses: re-actors/alls-green@a638d6464689bbb24c325bb3fe9404d63a913030
with:
allowed-skips: static-checks-builds, build-master, merge-library-files
jobs: ${{ toJson(needs) }}
Loading