Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added GitHub Actions for build and security analysis #491

Merged
merged 34 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7360521
Added GitHub Actions for build and security analysis
walbourn Jul 25, 2024
4548ea4
Add CodeQL
walbourn Jul 25, 2024
61da47d
Add paths-ignore for PR
walbourn Jul 25, 2024
955a0c0
Update ADO triggers
walbourn Jul 25, 2024
941b8e9
Add /analyze to GitHub Actions
walbourn Jul 26, 2024
828cb8d
Build shaders for /analyze
walbourn Jul 26, 2024
b1263eb
Fix script
walbourn Jul 26, 2024
193a571
Use cmd instead of pswh
walbourn Jul 26, 2024
a1ff9ec
Fix script again
walbourn Jul 26, 2024
cbdca6c
Another attempt
walbourn Jul 26, 2024
bce65db
Another attempt
walbourn Jul 26, 2024
151cfd0
Variable syntax!@
walbourn Jul 26, 2024
312b7a6
DDSView shaders
walbourn Jul 26, 2024
16056aa
Fix syntax
walbourn Jul 26, 2024
7fa000a
Code review
walbourn Jul 26, 2024
b8fdd9b
Add MSBuild to GitHub actions
walbourn Jul 26, 2024
e4d7fed
Build spectre configs
walbourn Jul 28, 2024
8e9a690
Fix build brfeak
walbourn Jul 28, 2024
06d0305
Update triggers for ADO to reduce overlap with GitHub Actions
walbourn Jul 28, 2024
589dfad
Add GitHub Actiosn test
walbourn Jul 28, 2024
648a0f8
Fix expression
walbourn Jul 28, 2024
750509a
Fixtests
walbourn Jul 29, 2024
50555d0
Tweak test
walbourn Jul 29, 2024
3716b6d
Add debugging
walbourn Jul 29, 2024
2dcac35
Fix syntax
walbourn Jul 29, 2024
05b7af3
Syntax fix
walbourn Jul 29, 2024
9f783b7
Debug option for ctest
walbourn Jul 29, 2024
a6bf70f
Fix variable syntax
walbourn Jul 29, 2024
1910030
So much syntax churn
walbourn Jul 29, 2024
5394249
More syntax joy
walbourn Jul 29, 2024
eb3cd0f
Struggling.
walbourn Jul 29, 2024
eb52564
Giving up on being clever
walbourn Jul 29, 2024
6ec3e84
Remove media suage
walbourn Jul 29, 2024
b3cc5ee
Minor code review
walbourn Jul 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926

name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.yml
schedule:
- cron: '43 3 * * 3'

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"
89 changes: 89 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926

name: 'CMake (Windows)'

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- 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 }}
76 changes: 76 additions & 0 deletions .github/workflows/msvc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#
# http://go.microsoft.com/fwlink/?LinkId=248926

name: Microsoft C++ Code Analysis

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
paths-ignore:
- '*.md'
- LICENSE
- '.nuget/*'
- build/*.cmd
- build/*.json
- build/*.props
- build/*.ps1
- build/*.targets
- build/*.yml
schedule:
- cron: '41 16 * * 1'

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

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64

- name: Configure CMake
working-directory: ${{ github.workspace }}
run: cmake -B out -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON

- name: 'Build Shaders (BC)'
shell: cmd
working-directory: ./DirectXTex/Shaders
run: CompileShaders.cmd
env:
CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled

- name: 'Build Shaders (DDSVIEW)'
shell: cmd
working-directory: ./DDSView
run: hlsl.cmd
env:
CompileShadersOutput: ${{ github.workspace }}/out/Shaders/Compiled

- 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 }}
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-CMake-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-CMake-Xbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-CMake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-Dev17.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -40,6 +41,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-GDK.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -39,6 +40,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-MinGW.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
3 changes: 3 additions & 0 deletions build/DirectXTex-GitHub-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -30,6 +31,7 @@ trigger:
- build/*.ps1
- build/*.targets
- Auxiliary/*

pr:
branches:
include:
Expand All @@ -39,6 +41,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub-WSL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ trigger:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand All @@ -35,6 +36,7 @@ pr:
exclude:
- '*.md'
- LICENSE
- '.github/*'
- '.nuget/*'
- build/*.cmd
- build/*.json
Expand Down
2 changes: 2 additions & 0 deletions build/DirectXTex-GitHub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ trigger:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand All @@ -40,6 +41,7 @@ pr:
- '*.md'
- LICENSE
- CMake*
- '.github/*'
- '.nuget/*'
- build/*.cmake
- build/*.cmd
Expand Down
Loading