summaryrefslogtreecommitdiff
path: root/.github/Build-with-GitHub.md
blob: c4a10962f31a97c03306232ac889a978528f915f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Using GitHub actions for building drivers

If you use GitHub to host your code, you can leverage [GitHub Actions](https://docs.github.com/en/actions) to create automated workflows to build your driver projects.

`windows-2022` runner (provided by `windows-latest`) is configured with Windows Driver Kit version 22H2 and Visual Studio 2022 off the box, so most solutions can be built by running `msbuild` directly.

```yaml
name: Build driver solution
on:
  push:
    branches:
      - main
jobs:
  build:
    strategy:
      matrix:
        configuration: [Debug, Release]
        platform: [x64]
    runs-on: windows-2022
    env:
      Solution_Path: path\to\driver\solution.sln
    steps:
      - name: Check out repository code
        uses: actions/checkout@v3

      - name: Add MSBuild to PATH
        uses: microsoft/[email protected]

      - name: Build solution
        run: |
          msbuild ${{ env.Solution_Path }} -p:Configuration:${{ env.Configuration }} -p:Platform:${{ env.Platform }}
        env:
          Configuration: ${{ matrix.configuration }}
          Platform: ${{ matrix.platform }}
```