chore(build): improve workflows (#150)

This commit is contained in:
fallenoak 2025-12-27 12:52:27 -06:00 committed by GitHub
parent dcd2f7dc49
commit 8443ba863f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 41 additions and 31 deletions

View File

@ -4,39 +4,46 @@ on: [pull_request]
jobs: jobs:
build: build:
name: ${{ matrix.config.name }} name: ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }}
runs-on: ${{ matrix.config.os }} runs-on: ${{ matrix.build.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
config: build:
- name: Ubuntu Latest (GCC) - system_name: Linux
os: ubuntu-latest build_type: Debug
build_type: Release compiler_name: GCC
test_path: WhoaTest test_path: WhoaTest
os: ubuntu-latest
cc: gcc cc: gcc
cxx: g++ cxx: g++
- name: macOS Latest (Clang) - system_name: macOS
os: macos-latest build_type: Debug
build_type: Release compiler_name: Clang
test_path: WhoaTest test_path: WhoaTest
os: macos-latest
cc: clang cc: clang
cxx: clang++ cxx: clang++
- name: Windows Latest (MSVC) - system_name: Windows
os: windows-latest build_type: Debug
build_type: Release compiler_name: MSVC
test_path: WhoaTest test_path: WhoaTest
os: windows-latest
cc: cl cc: cl
cxx: cl cxx: cl
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
- name: Install Dependencies (${{ matrix.build.os }})
run: sudo apt install -y lcov
if: matrix.build.os == 'ubuntu-latest'
- name: Download Fixtures - name: Download Fixtures
run: aws s3 cp --endpoint-url ${{ env.AWS_ENDPOINT_URL }} s3://reliquaryhq-whoa/fixture.tgz test/fixture/ run: aws s3 cp --endpoint-url ${{ env.AWS_ENDPOINT_URL }} s3://reliquaryhq-whoa/fixture.tgz test/fixture/
env: env:
@ -52,17 +59,17 @@ jobs:
run: mkdir build run: mkdir build
- name: Configure - name: Configure
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Build - name: Build
run: cmake --build . --config ${{ matrix.config.build_type }} run: cmake --build . --config ${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Install - name: Install
run: cmake --install . --config ${{ matrix.config.build_type }} run: cmake --install . --config ${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Test - name: Test
run: ../../build/dist/bin/${{ matrix.config.test_path }} run: ../../build/dist/bin/${{ matrix.build.test_path }}
working-directory: test/fixture working-directory: test/fixture

View File

@ -7,36 +7,39 @@ on:
jobs: jobs:
build: build:
name: ${{ matrix.config.name }} name: ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }}
runs-on: ${{ matrix.config.os }} runs-on: ${{ matrix.build.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
config: build:
- name: Ubuntu Latest (GCC) - system_name: Linux
os: ubuntu-latest
build_type: Release build_type: Release
compiler_name: GCC
test_path: WhoaTest test_path: WhoaTest
os: ubuntu-latest
cc: gcc cc: gcc
cxx: g++ cxx: g++
- name: macOS Latest (Clang) - system_name: macOS
os: macos-latest
build_type: Release build_type: Release
compiler_name: Clang
test_path: WhoaTest test_path: WhoaTest
os: macos-latest
cc: clang cc: clang
cxx: clang++ cxx: clang++
- name: Windows Latest (MSVC) - system_name: Windows
os: windows-latest
build_type: Release build_type: Release
compiler_name: MSVC
test_path: WhoaTest test_path: WhoaTest
os: windows-latest
cc: cl cc: cl
cxx: cl cxx: cl
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
@ -55,17 +58,17 @@ jobs:
run: mkdir build run: mkdir build
- name: Configure - name: Configure
run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} run: cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Build - name: Build
run: cmake --build . --config ${{ matrix.config.build_type }} run: cmake --build . --config ${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Install - name: Install
run: cmake --install . --config ${{ matrix.config.build_type }} run: cmake --install . --config ${{ matrix.build.build_type }}
working-directory: build working-directory: build
- name: Test - name: Test
run: ../../build/dist/bin/${{ matrix.config.test_path }} run: ../../build/dist/bin/${{ matrix.build.test_path }}
working-directory: test/fixture working-directory: test/fixture