Skip to content

Commit

Permalink
Reorganized workflows and add msvc analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
d-winsor committed Sep 15, 2021
1 parent d2936d1 commit 0a9ce91
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 51 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Analysis

on:
push:
paths-ignore:
- 'doc/**'
branches: [ master ]
pull_request:
paths-ignore:
- 'doc/**'
branches: [ master ]

env:
build: '${{ github.workspace }}/build'
results: '${{ github.workspace }}/build/results'

jobs:
build:
name: Microsoft C++ Code Analysis
runs-on: windows-2019

steps:
- uses: actions/checkout@v2

- name: Configure CMake
uses: lukka/run-cmake@v3
with:
buildDirectory: ${{ env.build }}
buildWithCMake: false
cmakeGenerator: VS16Win64

- name: Run Microsoft Visual C++ Analysis
uses: microsoft/msvc-code-analysis-action@redesign
with:
cmakeBuildDirectory: ${{ env.build }}
ignoreSystemHeaders: true
resultsDirectory: ${{ env.results }}
ruleset: AllRules.ruleset

- name: Upload SARIF as Artifacts
uses: actions/upload-artifact@v2
with:
name: sarif-files
path: ${{ env.results }}

- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: ${{ env.results }}
21 changes: 14 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,34 @@
name: Ubuntu-Docs
name: Docs

on:
push:
paths:
- 'doc/**'
- '.github/workflows/docs.yaml'
branches: [ master ]
pull_request:
paths:
- 'doc/**'
- '.github/workflows/docs.yaml'
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
name: Build Ubuntu

steps:
- uses: actions/checkout@v2

- name: Install GCC, CMake
run: sudo apt-get install build-essential cmake texlive texlive-latex-extra
run: |
sudo apt-get update
sudo apt-get install build-essential cmake texlive texlive-latex-extra
- name: Configure CMake
run: mkdir build && cmake -Bbuild -DBUILD_DOC=ON

- name: Build project
run: make -C build doc
- name: Configure & Build CMake
uses: lukka/run-cmake@v3
with:
buildDirectory: build
cmakeAppendedArgs: -DBUILD_DOC=ON
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
buildWithCMakeArgs: --target doc
28 changes: 0 additions & 28 deletions .github/workflows/mac.yml

This file was deleted.

40 changes: 25 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu-Build
name: CI

on:
push:
Expand All @@ -11,24 +11,34 @@ on:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
build-test:
runs-on: ${{ matrix.os }}
name: Build & Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
compiler: [g++-10, clang++-12]
os: [ubuntu-latest, macos-latest]
generator: [UnixMakefiles]
include:
- os: windows-latest
generator: VS16Win64

steps:
- uses: actions/checkout@v2

- name: Install GCC, Clang, CMake
run: sudo apt-get install build-essential cmake

- name: Configure CMake
run: mkdir build && cmake -Bbuild -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}

- name: Build project
run: cmake --build ./build --parallel

- name: Run tests
run: cmake --build ./build --target test --parallel
- name: Install GCC, CMake
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install build-essential cmake
- name: Configure & Build
uses: lukka/run-cmake@v3
with:
buildDirectory: build
buildWithCMakeArgs: --parallel
cmakeGenerator: ${{ matrix.generator }}

- name: Run Tests
run: ctest build

2 changes: 1 addition & 1 deletion tests/unit-tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ target_link_libraries(${TEST_BINARY}
)

target_include_directories(${TEST_BINARY}
PRIVATE ${DOCTEST_INCLUDE_DIR}
SYSTEM PRIVATE ${DOCTEST_INCLUDE_DIR}
)

set_target_properties(${TEST_BINARY}
Expand Down

0 comments on commit 0a9ce91

Please sign in to comment.