adds linting to ci/ cd #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: hosted-ninja-vcpkg_submod-autocache | |
on: | |
push: | |
pull_request: | |
branches: | |
- 'v*' | |
- main | |
- test-pipeline | |
tags: | |
- "v*.*.*" | |
workflow_dispatch: | |
env: | |
# Path to the CMake build directory. | |
build: '${{ github.workspace }}' | |
config: 'release-config' | |
jobs: | |
build: | |
name: ${{ matrix.os }}-${{ github.workflow }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
# fail-fast: false | |
matrix: | |
os: [windows-latest] | |
# os: [ubuntu-latest, macos-latest, windows-latest] | |
#env: | |
# | |
# [OPTIONAL] Define the vcpkg's triplet | |
# you want to enforce, otherwise the default one | |
# for the hosting system will be automatically | |
# choosen (x64 is the default on all platforms, | |
# e.g. x64-osx). | |
# VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | |
steps: | |
################ | |
# Build - Test # | |
################ | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: lukka/get-cmake@latest | |
- name: Restore from cache and setup vcpkg executable and data files. | |
uses: lukka/run-vcpkg@v11 | |
with: | |
vcpkgJsonGlob: 'vcpkg.json' | |
- name: Run CMake+vcpkg+Ninja+CTest to build packages and generate/build/test the code. | |
uses: lukka/run-cmake@v10 | |
with: | |
configurePreset: 'release-config' | |
buildPreset: 'release-build' | |
testPreset: 'test-release' | |
######## | |
# Lint # | |
######## | |
- name: Run MSVC Code Analysis | |
uses: microsoft/[email protected] | |
# Provide a unique ID to access the sarif output path | |
id: run-analysis | |
with: | |
cmakeBuildDirectory: ${{ env.build }} | |
buildConfiguration: ${{ env.config }} | |
# Ruleset file that will determine what checks will be run | |
ruleset: NativeRecommendedRules.ruleset | |
# Paths to ignore analysis of CMake targets and includes | |
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test | |
# Upload SARIF file to GitHub Code Scanning Alerts | |
- name: Upload SARIF to GitHub | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: ${{ steps.run-analysis.outputs.sarif }} | |
# Upload SARIF file as an Artifact to download and view | |
- name: Upload SARIF as an Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: sarif-file | |
path: ${{ steps.run-analysis.outputs.sarif }} | |
#################### | |
# Release Binaries # | |
#################### | |
- run: ls builds/release-config/Release/ | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
builds/release-config/Release/*.exe | |
builds/release-config/Release/*.dll |