Skip to content

Commit

Permalink
Merged PR 20819: Actions and AZP configuration for GitHub repo
Browse files Browse the repository at this point in the history
  • Loading branch information
thhous-msft authored and nibanks committed May 19, 2022
1 parent 9d868cf commit 0c1711a
Show file tree
Hide file tree
Showing 11 changed files with 453 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @Microsoft/xdp will be requested for review when someone
# opens a pull request.

* @Microsoft/xdp
9 changes: 9 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Microsoft Open Source Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).

Resources:

- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
41 changes: 41 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.3 BLOCK -->

## Security

Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).

If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below.

## Reporting Security Issues

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue

This information will help us triage your report more quickly.

If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.

## Preferred Languages

We prefer all communications to be in English.

## Policy

Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).

<!-- END MICROSOFT SECURITY.MD BLOCK -->
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
231 changes: 231 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,231 @@
name: CI

on:
push:
branches:
- main
- release/*
- prerelease/*
- thadhouse/actions # Temporary
pull_request:
branches:
- main
- release/*
- prerelease/*

concurrency:
# Cancel any workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: ci-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

permissions: read-all

jobs:
build:
name: Build
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
platform: [x64]
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
with:
submodules: recursive
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@ab534842b4bdf384b8aaf93765dc6f721d9f5fab
- name: Prepare Machine
shell: pwsh
run: tools/prepare-machine.ps1 -ForBuild -Verbose
- name: Nuget Restore
run: nuget.exe restore xdp.sln
- name: Build
run: msbuild xdp.sln /m /p:configuration=${{ matrix.configuration }} /p:platform=${{ matrix.platform }}
- name: Clean up Artifacts
shell: pwsh
run: .azure/scripts/clean-artifacts.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Sign and Package
shell: pwsh
run: tools/sign.ps1 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Artifacts
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: |
artifacts/bin
!artifacts/bin/**/*.ilk
!artifacts/bin/**/*.exp
!artifacts/bin/**/*.lastcodeanalysissucceeded
- uses: microsoft/action-publish-symbols@61a07464e0b78d726c5c6c42efd3224eb982d1cf
with:
accountName: mscodehub
symbolServiceUrl: 'https://artifacts.dev.azure.com'
personalAccessToken: ${{ secrets.AZDO_PAT }}

functional_tests:
name: Functional Tests
needs: build
env:
# For 'main' commits
fullRuntime: 60 # minutes
fullIters: 10
# For PRs
prRuntime: 5 # minutes
prIters: 1
strategy:
fail-fast: false
matrix:
windows: [2019, 2022]
configuration: [Release, Debug]
platform: [x64]
runs-on: windows-${{ matrix.windows }}
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
- name: Check Drivers
shell: pwsh
run: tools/check-drivers.ps1 -Verbose
- name: Prepare Machine
shell: pwsh
run: tools/prepare-machine.ps1 -ForTest -NoReboot -Verbose
- name: Download Artifacts
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run Tests (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: pwsh
#timeout-minutes: ${{ env.prRuntime }}
run: tools/functional.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Iterations ${{ env.prIters }}
- name: Run Tests (main)
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
# currently getting a weird error:
# .github/workflows/ci.yml (Line: 107, Col: 24): Unexpected value '60'
#timeout-minutes: ${{ env.fullRuntime }}
run: tools/functional.ps1 -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Iterations ${{ env.fullIters }}
- name: Convert Logs
if: ${{ always() }}
shell: pwsh
run: tools/log.ps1 -Convert -Name xdpfunc* -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Logs
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
if: ${{ always() }}
with:
name: logs_func_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: pwsh
run: tools/check-drivers.ps1 -Verbose

stress_tests:
name: Stress Tests
needs: build
env:
successThresholdPercent: 50
xdpmpPollProvider: 'FNDIS'
# For 'main' commits
fullRuntime: 60 # minutes
fullTimeout: 65 # minutes
# For PRs
prRuntime: 10 # minutes
prTimeout: 15 # minutes
strategy:
fail-fast: false
matrix:
windows: [2019, 2022]
configuration: [Release, Debug]
platform: [x64]
timeout-minutes: 75 # Ideally this would be only 25 min for PR runs, but GitHub Actions don't support that.
runs-on: windows-${{ matrix.windows }}
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
- name: Check Drivers
shell: pwsh
run: tools/check-drivers.ps1 -Verbose
- name: Prepare Machine
shell: pwsh
run: tools/prepare-machine.ps1 -ForTest -NoReboot -Verbose
- name: Download Artifacts
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Run spinxsk (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: pwsh
#timeout-minutes: ${{ env.prTimeout }}
run: tools/spinxsk.ps1 -Verbose -Stats -QueueCount 2 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Minutes ${{ env.prRuntime }} -XdpmpPollProvider ${{ env.xdpmpPollProvider }} -SuccessThresholdPercent ${{ env.successThresholdPercent }}
- name: Run spinxsk (main)
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
#timeout-minutes: ${{ env.fullTimeout }}
run: tools/spinxsk.ps1 -Verbose -Stats -QueueCount 2 -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }} -Minutes ${{ env.fullRuntime }} -XdpmpPollProvider ${{ env.xdpmpPollProvider }} -SuccessThresholdPercent ${{ env.successThresholdPercent }}
- name: Convert Logs
if: ${{ always() }}
shell: pwsh
run: tools/log.ps1 -Convert -Name spinxsk -Verbose -Config ${{ matrix.configuration }} -Arch ${{ matrix.platform }}
- name: Upload Logs
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
if: ${{ always() }}
with:
name: logs_stress_win${{ matrix.windows }}_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/logs
- name: Check Drivers
if: ${{ always() }}
shell: pwsh
run: tools/check-drivers.ps1 -Verbose

devkit:
name: Dev Kit
needs: build
strategy:
fail-fast: false
matrix:
configuration: [Release]
platform: [x64]
runs-on: windows-2019
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
- name: Download Artifacts
uses: actions/download-artifact@fb598a63ae348fa914e94cd0ff38f362e927b741
with:
name: bin_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/bin
- name: Create Dev Kit
shell: pwsh
run: tools/create-devkit.ps1 -Flavor ${{ matrix.configuration }} -Platform ${{ matrix.platform }}
- name: Upload Kit
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: devkit_${{ matrix.configuration }}_${{ matrix.platform }}
path: artifacts/kit

etw:
name: ETW Plugin
needs: []
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
- name: Setup .NET
uses: actions/setup-dotnet@9211491ffb35dd6a6657ca4f45d43dfe6e97c829
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build src\xdpetwplugin\xdpetwplugin.sln -c ${{ matrix.configuration }}
- uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: etw_${{ matrix.configuration }}
path: artifacts/bin
30 changes: 30 additions & 0 deletions .github/workflows/mirror-repo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Mirror

on:
push:
branches:
- main
- release/*
- prerelease/*
tags:
- v*

permissions: read-all

jobs:
mirror:
permissions:
contents: read # for actions/checkout to fetch code
name: Mirror
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@629c2de402a417ea7690ca6ce3f33229e27606a5
with:
fetch-depth: 0
- name: Sync mirror
shell: pwsh
env:
AzDO_PAT: ${{ secrets.AZDO_PAT }}
Source: ${{ github.ref }} # refs/heads/<branch_name> or refs/tags/<tag_name>
run: tools/sync-mirror.ps1 -Source $env:Source
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) Microsoft Corporation.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# How to develop WinXDP
# How to develop XDP for Windows

## Get the code

Clone this repo and ensure all submodules are cloned with the `--recursive` option:

```
git clone https://mscodehub.visualstudio.com/WindowsXDP/_git/xdp --recursive
git clone https://github.com/microsoft/xdp-for-windows.git --recursive
```

Or, if the repo was already cloned nonrecursively:
Expand Down
4 changes: 2 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# How to use WinXDP
# How to use XDP for Windows

## Installation

WinXDP consists of a usermode library (xdpapi.dll) and a driver (xdp.sys).
XDP for Windows consists of a usermode library (xdpapi.dll) and a driver (xdp.sys).

If xdp.sys is not production-signed:
```PowerShell
Expand Down
Loading

0 comments on commit 0c1711a

Please sign in to comment.