Skip to content

Commit

Permalink
Make a smoke test CI for PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpdemarco committed Feb 23, 2024
1 parent a0613c9 commit 73d4017
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml → .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: ci
name: ci-main
on:
pull_request:
release:
types: [published]
push:
tags:
branches:
- main
- develop
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: ci-pr
on:
pull_request:
branches:
- main

env:
VERBOSE: 1

jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

matrix:
os:
- ubuntu-20.04
- macos-10.15
- windows-2019
compiler:
# you can specify the version after `-` like "llvm-15.0.2".
- llvm-15.0.2
- gcc-11
generator:
- "Ninja Multi-Config"
build_type:
- Debug
packaging_maintainer_mode:
- OFF
build_shared:
- OFF

exclude:
# mingw is determined by this author to be too buggy to support
- os: windows-2019
compiler: gcc-11

include:
# Windows msvc builds
- os: windows-2022
compiler: msvc
generator: "Visual Studio 17 2022"
build_type: Debug
packaging_maintainer_mode: Off
enable_ipo: On

steps:
- name: Check for llvm version mismatches
if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen')
- uses: actions/checkout@v3

- name: Setup Cache
uses: ./.github/actions/setup_cache
with:
compiler: ${{ matrix.compiler }}
build_type: ${{ matrix.build_type }}
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }}
generator: ${{ matrix.generator }}

- name: Project Name
uses: cardinalby/export-env-action@v2
with:
envFile: '.github/constants.env'


- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}

cmake: true
ninja: true
vcpkg: false
ccache: true

- name: Configure CMake
run: |
cmake -S . -B ./build -G "${{matrix.generator}}" -D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{matrix.enable_ipo }} -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }}
- name: Build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
cmake --build ./build --config ${{matrix.build_type}}
- name: Tests
working-directory: ./build
run: |
ctest -C ${{matrix.build_type}}

0 comments on commit 73d4017

Please sign in to comment.