Skip to content

Commit

Permalink
Add build & test CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgunter committed Aug 3, 2024
1 parent a5be0b7 commit 563456f
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI

on:
pull_request:
push:
branches:
- main
tags:
- "*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-test:
strategy:
matrix:
platform:
- { label: Linux x86_64, value: ubuntu-latest }
compiler:
- { label: GCC, value: gcc }
# - { label: GCC v10, value: gcc-10.5.0 }
# - { label: GCC v11, value: gcc-11.5.0 }
# - { label: GCC v12, value: gcc-12.4.0 }
# - { label: GCC v13, value: gcc-13.3.0 }
# - { label: GCC v14, value: gcc-14.1.0 }
- { label: LLVM, value: llvm }
- { label: LLVM v10, value: llvm-10.0.1 }
- { label: LLVM v11, value: llvm-11.1.0 }
- { label: LLVM v12, value: llvm-12.0.1 }
- { label: LLVM v13, value: llvm-13.0.1 }
# - { label: LLVM v14, value: llvm-14.0.6 }
- { label: LLVM v15, value: llvm-15.0.7 }
- { label: LLVM v16, value: llvm-16.0.6 }
- { label: LLVM v17, value: llvm-17.0.6 }
- { label: LLVM v18, value: llvm-18.1.8 }
build-type:
- { label: Release, value: release }
include:
- platform: { label: macOS arm64, value: macos-latest }
compiler: { label: LLVM, value: llvm }
build-type: { label: Release, value: release }
- platform: { label: macOS x86_64, value: macos-12 }
compiler: { label: LLVM, value: llvm }
build-type: { label: Release, value: release }
- platform: { label: Windows x86_64, value: windows-latest }
compiler: { label: MSVC, value: msvc }
build-type: { label: Release, value: release }
- platform: { label: Linux x86_64, value: ubuntu-latest }
compiler: { label: GCC, value: gcc }
build-type: { label: Debug, value: debug }
- platform: { label: Linux x86_64, value: ubuntu-latest }
compiler: { label: LLVM, value: llvm }
build-type: { label: Debug, value: debug }
fail-fast: false
name: ${{ matrix.platform.label }} • ${{ matrix.compiler.label }} • ${{ matrix.build-type.label }}
runs-on: ${{ matrix.platform.value }}
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
submodules: true
- uses: aminya/[email protected]
with:
compiler: ${{ matrix.compiler.value }}
- uses: lukka/[email protected]
- uses: lukka/[email protected]
- uses: lukka/[email protected]
with:
workflowPreset: ${{ matrix.build-type.value }}
37 changes: 37 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{
"name": "release",
"generator": "Ninja",
"toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
Expand Down Expand Up @@ -50,5 +51,41 @@
"inherits": "release",
"configurePreset": "debug"
}
],
"workflowPresets": [
{
"name": "release",
"steps": [
{
"type": "configure",
"name": "release"
},
{
"type": "build",
"name": "release"
},
{
"type": "test",
"name": "release"
}
]
},
{
"name": "debug",
"steps": [
{
"type": "configure",
"name": "debug"
},
{
"type": "build",
"name": "debug"
},
{
"type": "test",
"name": "debug"
}
]
}
]
}
19 changes: 19 additions & 0 deletions vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"dependencies": [
"catch2"
],
"vcpkg-configuration": {
"default-registry": {
"kind": "git",
"baseline": "1de2026f28ead93ff1773e6e680387643e914ea1",
"repository": "https://github.com/microsoft/vcpkg"
},
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
]
}
}

0 comments on commit 563456f

Please sign in to comment.