-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added GitHub Actions for build and security analysis (#164)
- Loading branch information
Showing
19 changed files
with
527 additions
and
113 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# http://go.microsoft.com/fwlink/?LinkID=512686 | ||
|
||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '*.md' | ||
- LICENSE | ||
- '.nuget/*' | ||
- build/*.mdb | ||
- build/*.props | ||
- build/*.ps1 | ||
- build/*.yml | ||
schedule: | ||
- cron: '19 19 * * 0' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze (C/C++) | ||
runs-on: windows-latest | ||
timeout-minutes: 360 | ||
permissions: | ||
security-events: write | ||
packages: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: 'Install Ninja' | ||
run: choco install ninja | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: c-cpp | ||
build-mode: manual | ||
|
||
- name: 'Configure CMake' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --preset=x64-Debug | ||
|
||
- name: 'Build' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --build out\build\x64-Debug | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:c-cpp" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# http://go.microsoft.com/fwlink/?LinkID=512686 | ||
|
||
name: 'CMake (Windows)' | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '*.md' | ||
- LICENSE | ||
- '.nuget/*' | ||
- build/*.mdb | ||
- build/*.props | ||
- build/*.ps1 | ||
- build/*.yml | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
os: [windows-2019, windows-2022] | ||
build_type: [x64-Debug, x64-Release, x64-Debug-Clang, x64-Release-Clang] | ||
arch: [amd64] | ||
include: | ||
- os: windows-2019 | ||
build_type: x86-Debug | ||
arch: amd64_x86 | ||
- os: windows-2019 | ||
build_type: x86-Release | ||
arch: amd64_x86 | ||
- os: windows-2019 | ||
build_type: x86-Debug-Clang | ||
arch: amd64_x86 | ||
- os: windows-2019 | ||
build_type: x86-Release-Clang | ||
arch: amd64_x86 | ||
- os: windows-2022 | ||
build_type: x86-Debug | ||
arch: amd64_x86 | ||
- os: windows-2022 | ||
build_type: x86-Release | ||
arch: amd64_x86 | ||
- os: windows-2022 | ||
build_type: x86-Debug-Clang | ||
arch: amd64_x86 | ||
- os: windows-2022 | ||
build_type: x86-Release-Clang | ||
arch: amd64_x86 | ||
- os: windows-2022 | ||
build_type: arm64-Debug | ||
arch: amd64_arm64 | ||
- os: windows-2022 | ||
build_type: arm64-Release | ||
arch: amd64_arm64 | ||
- os: windows-2022 | ||
build_type: arm64ec-Debug | ||
arch: amd64_arm64 | ||
- os: windows-2022 | ||
build_type: arm64ec-Release | ||
arch: amd64_arm64 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 'Install Ninja' | ||
run: choco install ninja | ||
|
||
- uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
|
||
- name: 'Configure CMake' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --preset=${{ matrix.build_type }} | ||
|
||
- name: 'Build' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --build out\build\${{ matrix.build_type }} | ||
|
||
- if: matrix.arch != 'amd64_arm64' | ||
name: 'Configure CMake (Spectre)' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --preset=${{ matrix.build_type }} -DENABLE_SPECTRE_MITIGATION=ON | ||
|
||
- if: matrix.arch != 'amd64_arm64' | ||
name: 'Build (Spectre)' | ||
working-directory: ${{ github.workspace }} | ||
run: cmake --build out\build\${{ matrix.build_type }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# http://go.microsoft.com/fwlink/?LinkID=512686 | ||
|
||
name: MSBuild | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '*.md' | ||
- LICENSE | ||
- '.nuget/*' | ||
- build/* | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-${{ matrix.vs }} | ||
|
||
strategy: | ||
fail-fast: false | ||
|
||
matrix: | ||
vs: [2019, 2022] | ||
build_type: [Debug, Release] | ||
platform: [x86, x64, ARM64] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/setup-msbuild@v2 | ||
|
||
- if: matrix.platform != 'ARM64' | ||
name: Restore NuGet packages | ||
working-directory: ${{ github.workspace }} | ||
run: nuget restore ./UVAtlas_${{ matrix.vs }}_Win10.sln | ||
|
||
- name: 'Build' | ||
working-directory: ${{ github.workspace }} | ||
run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./UVAtlas_${{ matrix.vs }}_Win10.sln | ||
|
||
- if: matrix.vs == '2022' | ||
name: 'Build (UWP)' | ||
working-directory: ${{ github.workspace }} | ||
run: msbuild /m /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./UVAtlas_Windows10_2022.sln | ||
|
||
- if: matrix.platform != 'ARM64' | ||
name: 'Build (Spectre)' | ||
working-directory: ${{ github.workspace }} | ||
run: msbuild /m /p:SpectreMitigation=Spectre /p:Configuration=${{ matrix.build_type }} /p:Platform=${{ matrix.platform }} ./UVAtlas_${{ matrix.vs }}_Win10.sln |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# http://go.microsoft.com/fwlink/?LinkID=512686 | ||
|
||
name: Microsoft C++ Code Analysis | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- '*.md' | ||
- LICENSE | ||
- '.nuget/*' | ||
- build/*.mdb | ||
- build/*.props | ||
- build/*.ps1 | ||
- build/*.yml | ||
schedule: | ||
- cron: '31 18 * * 5' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
analyze: | ||
permissions: | ||
contents: read | ||
security-events: write | ||
actions: read | ||
name: Analyze | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Configure CMake | ||
working-directory: ${{ github.workspace }} | ||
run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON | ||
|
||
- name: Initialize MSVC Code Analysis | ||
uses: microsoft/[email protected] | ||
id: run-analysis | ||
with: | ||
cmakeBuildDirectory: ./out | ||
buildConfiguration: Debug | ||
ruleset: NativeRecommendedRules.ruleset | ||
|
||
# Upload SARIF file to GitHub Code Scanning Alerts | ||
- name: Upload SARIF to GitHub | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.run-analysis.outputs.sarif }} |
Oops, something went wrong.