Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 10 additions & 6 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ on:
branches: ["master"]
pull_request:
branches: ["master"]

env:
dotnet-version: 9.0

jobs:
AFL:
runs-on: ubuntu-latest

env:
dotnet-version: "9.0"

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
Expand All @@ -25,15 +25,19 @@ jobs:
run: sudo sh -c "echo core >/proc/sys/kernel/core_pattern"
- name: Run AFL tests
shell: pwsh
run: ./scripts/test.ps1
run: ./scripts/test.ps1 ${{ env.dotnet-version }}

libFuzzer:
runs-on: windows-latest

strategy:
matrix:
dotnet-version: ["8.0", "9.0"]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
dotnet-version: ${{ matrix.dotnet-version }}
- name: Run libFuzzer tests
run: ./scripts/test-libfuzzer.ps1
run: ./scripts/test-libfuzzer.ps1 ${{ matrix.dotnet-version }}
7 changes: 6 additions & 1 deletion scripts/test-libfuzzer.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
param(
[Parameter(Mandatory=$true)]
[string]$dotnetVersion
)

$libFuzzer = "libfuzzer-dotnet-windows.exe"
$uri = "https://github.com/metalnem/libfuzzer-dotnet/releases/latest/download/$libFuzzer"
$corpus = "corpus"
Expand All @@ -8,7 +13,7 @@ New-Item -Path $corpus -ItemType Directory
dotnet publish src/SharpFuzz.CommandLine/SharpFuzz.CommandLine.csproj `
--output out `
--configuration release `
--framework net9.0
--framework "net$dotnetVersion"

& scripts/fuzz-libfuzzer.ps1 `
-libFuzzer "./$libFuzzer" `
Expand Down
7 changes: 6 additions & 1 deletion scripts/test.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
param(
[Parameter(Mandatory=$true)]
[string]$dotnetVersion
)

New-Item -Path "corpus/test" -ItemType File -Force -Value "W"

dotnet publish src/SharpFuzz.CommandLine/SharpFuzz.CommandLine.csproj `
--output out `
--configuration release `
--framework net9.0
--framework "net$dotnetVersion"

& scripts/fuzz.ps1 `
-project tests/Library.Fuzz/Library.Fuzz.csproj `
Expand Down
Loading