-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
406 additions
and
0 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
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
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,92 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# https://go.microsoft.com/fwlink/?LinkID=324981 | ||
|
||
# OneFuzz code coverage pipeline | ||
|
||
pr: none | ||
trigger: none | ||
|
||
resources: | ||
repositories: | ||
- repository: self | ||
type: git | ||
ref: refs/heads/main | ||
- repository: testRepo | ||
name: walbourn/directxmeshtest | ||
type: github | ||
endpoint: microsoft | ||
ref: refs/heads/main | ||
|
||
pool: | ||
vmImage: windows-latest | ||
|
||
parameters: | ||
- name: sasUrl | ||
type: string | ||
displayName: SAS URL | ||
- name: branch | ||
type: string | ||
displayName: Branch | ||
- name: jobID | ||
type: string | ||
displayName: OneFuzz Job ID | ||
- name: buildDate | ||
type: string | ||
displayName: Build Date | ||
- name: commitID | ||
type: string | ||
displayName: Commit ID | ||
|
||
variables: | ||
- name: coverage-file | ||
value: cobertura-coverage.xml | ||
- name: job-ID | ||
value: ${{ parameters.jobID }} | ||
- name: build-date | ||
value: ${{ parameters.buildDate }} | ||
- name: branch | ||
value: ${{ parameters.branch }} | ||
- name: sas-url | ||
value: ${{ parameters.sasUrl }} | ||
- name: commit-ID | ||
value: ${{ parameters.commitID }} | ||
|
||
jobs: | ||
- job: prod | ||
displayName: Prod Task | ||
workspace: | ||
clean: all | ||
steps: | ||
- checkout: self | ||
clean: true | ||
fetchTags: false | ||
fetchDepth: 1 | ||
path: 's' | ||
- checkout: testRepo | ||
displayName: Fetch Tests | ||
clean: true | ||
fetchTags: false | ||
fetchDepth: 1 | ||
path: 's/Tests' | ||
- powershell: | | ||
Write-Host "Job ID: $(job-ID), Build Date: $(build-date), Branch: $(branch)" | ||
$SASUrl = [System.Uri]::new("$(sas-url)") | ||
azcopy cp $SASUrl.AbsoluteUri ./ --recursive | ||
$ContainerName = $SASURL.LocalPath.Split("/")[1] | ||
Write-Host "##vso[task.setvariable variable=container-name;]$ContainerName" | ||
cd $ContainerName | ||
$size = ((Get-Item .\$(coverage-file)).length) | ||
if ($size -eq 0) { | ||
Write-Host "Cobertura coverage XML is empty." | ||
exit 1 | ||
} | ||
displayName: 'Get code coverage from OneFuzz' | ||
- task: PublishCodeCoverageResults@1 | ||
inputs: | ||
codeCoverageTool: 'Cobertura' | ||
summaryFileLocation: ./$(container-name)\$(coverage-file) | ||
pathToSources: $(Build.SourcesDirectory) | ||
displayName: 'Generate coverage report' |
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,146 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
# | ||
# https://go.microsoft.com/fwlink/?LinkID=324981 | ||
|
||
# Builds the library using CMake and submit for file fuzzing | ||
|
||
schedules: | ||
- cron: "0 12 1 * *" | ||
displayName: 'Submit for File Fuzzing (Monthly)' | ||
branches: | ||
include: | ||
- main | ||
always: true | ||
|
||
trigger: none | ||
pr: none | ||
|
||
resources: | ||
repositories: | ||
- repository: self | ||
type: git | ||
ref: refs/heads/main | ||
- repository: testRepo | ||
name: walbourn/directxmeshtest | ||
type: github | ||
endpoint: microsoft | ||
ref: refs/heads/main | ||
|
||
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) | ||
|
||
variables: | ||
Codeql.Enabled: false | ||
VS_GENERATOR: 'Visual Studio 17 2022' | ||
WIN11_SDK: '10.0.22000.0' | ||
|
||
pool: | ||
vmImage: windows-2022 | ||
|
||
jobs: | ||
- job: FUZZ_BUILD | ||
displayName: 'Build for file fuzzing' | ||
steps: | ||
- checkout: self | ||
clean: true | ||
fetchTags: false | ||
fetchDepth: 1 | ||
path: 's' | ||
- checkout: testRepo | ||
displayName: Fetch Tests | ||
clean: true | ||
fetchTags: false | ||
fetchDepth: 1 | ||
path: 's/Tests' | ||
- task: CMake@1 | ||
displayName: 'CMake (MSVC): Config with ASan' | ||
inputs: | ||
cwd: '$(Build.SourcesDirectory)' | ||
cmakeArgs: '-G "$(VS_GENERATOR)" -A x64 -B out -DCMAKE_SYSTEM_VERSION=$(WIN11_SDK) -DBUILD_TOOLS=OFF -DBUILD_FUZZING=ON -DBUILD_TESTING=OFF' | ||
- task: CMake@1 | ||
displayName: 'CMake (MSVC): Build with ASan' | ||
inputs: | ||
cwd: '$(Build.SourcesDirectory)' | ||
cmakeArgs: --build out -v --config RelWithDebInfo | ||
- task: CopyFiles@2 | ||
displayName: Copy fuzzer | ||
inputs: | ||
Contents: | | ||
build\OneFuzzConfig.json | ||
out\bin\RelWithDebInfo\fuzzloaders.exe | ||
TargetFolder: .drop | ||
OverWrite: true | ||
flattenFolders: true | ||
- task: CopyFiles@2 | ||
displayName: Copy symbols | ||
inputs: | ||
Contents: | | ||
out\bin\RelWithDebInfo\fuzzloaders.pdb | ||
TargetFolder: .drop\symbols | ||
OverWrite: true | ||
flattenFolders: true | ||
- task: PowerShell@2 | ||
displayName: Download seed files | ||
inputs: | ||
targetType: inline | ||
script: | | ||
$seedfiles = "AlphaEdge.dds", | ||
"cubea8r8g8b8.dds", | ||
"default_texture_nm.dds", | ||
"dx5_logo.dds", | ||
"hdrtest.dds", | ||
"normalmap.dds", | ||
"grad4d.hdr", | ||
"grad4dunc.hdr", | ||
"BigTree.hdr", | ||
"CBW8.TGA", | ||
"ccm8.tga", | ||
"CTC16.TGA", | ||
"CTC24.TGA", | ||
"CTC32.TGA", | ||
"UTC16.TGA", | ||
"UTC24.TGA", | ||
"UTC32.TGA", | ||
"UBW8.TGA", | ||
"ucm8.tga", | ||
"testimg.ppm", | ||
"grad4d.pfm"; | ||
New-Item -ItemType Directory -Force -Path .drop\seeds\ | ||
foreach($filename in $seedfiles) | ||
{ | ||
Write-Host "Fetching: $filename" | ||
$url = "https://raw.githubusercontent.com/walbourn/directxmeshmedia/main/" + $filename | ||
$target = [System.IO.Path]::Combine(".drop\seeds\", $filename) | ||
Invoke-WebRequest -Uri $url -OutFile $target | ||
} | ||
- task: PowerShell@2 | ||
displayName: Copy OneFuzz setup script | ||
inputs: | ||
targetType: 'inline' | ||
script: | | ||
Copy-Item -Path .\build\onefuzz-setup.ps1 -Destination .drop/setup.ps1 | ||
- task: MSBuild@1 | ||
displayName: 'Copy ASan binaries' | ||
inputs: | ||
solution: build/CopyASAN.targets | ||
msbuildArguments: /p:TargetFolder=$(Build.SourcesDirectory)\.drop | ||
msbuildVersion: 17.0 | ||
msbuildArchitecture: x64 | ||
- task: PowerShell@2 | ||
displayName: List drop files | ||
inputs: | ||
targetType: inline | ||
script: | | ||
Get-ChildItem ".drop" -Recurse | select FullName | ||
- task: onefuzz-task@0 | ||
displayName: 'Submit to OneFuzz' | ||
inputs: | ||
onefuzzOSes: 'Windows' | ||
env: | ||
onefuzzDropDirectory: $(Build.SourcesDirectory)\.drop | ||
SYSTEM_ACCESSTOKEN: $(System.AccessToken) |
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
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,49 @@ | ||
{ | ||
"ConfigVersion": 3, | ||
"Entries": [ | ||
{ | ||
"MinAvailableMemoryMB": 50, | ||
"JobNotificationEmail": "[email protected]", | ||
"Skip": false, | ||
"Fuzzer": { | ||
"$type": "libfuzzer", | ||
"FuzzingHarnessExecutableName": "fuzzloaders.exe", | ||
"FuzzingTargetBinaries": [ | ||
"fuzzloaders.exe" | ||
] | ||
}, | ||
"RebootAfterSetup": false, | ||
"OneFuzzJobs": [ | ||
{ | ||
"ProjectName": "Direct3D", | ||
"TargetName": "DirectXMesh", | ||
"TargetOptions": [ | ||
" -rss_limit_mb=4096" | ||
], | ||
"TargetEnv": { | ||
"ASAN_OPTIONS": "allocator_may_return_null=1" | ||
} | ||
} | ||
], | ||
"JobDependencies": [ | ||
"fuzzloaders.exe", | ||
"fuzzloaders.pdb", | ||
"clang_rt.asan_dynamic-x86_64.dll", | ||
"msdia140.dll", | ||
"setup.ps1" | ||
], | ||
"AdoTemplate": { | ||
"Org": "microsoft", | ||
"Project": "OS", | ||
"AssignedTo": "[email protected]", | ||
"AreaPath": "OS\\Core\\SiGMa\\GRFX-Graphics", | ||
"IterationPath": "OS\\Future" | ||
}, | ||
"CodeCoverage": { | ||
"Org": "mscodehub", | ||
"Project": "DirectXMesh", | ||
"PipelineId": "1" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.