aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/ci.yml
blob: fb3b2cb5b3acabed4619d5d386326fd168819e19 (plain) (blame)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: CI

on:
  push:
  workflow_dispatch:

jobs:
  lint:
    runs-on: ubuntu-latest
    name: Linting
    continue-on-error: ${{ github.ref != 'refs/heads/master' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: recursive
      - name: Set up clang-format
        uses: egor-tensin/setup-clang@v2
        with:
          # To use the latest clang-format features:
          version: 22
      - name: Run clang-format
        uses: egor-tensin/clang-format@v1
        with:
          version: 22

  build:
    strategy:
      matrix:
        # As of June '26, WDK doesn't seem to be included in VS 2026 (windows-2026) images.
        toolset: [vs2022]
        platform: [x64]
        configuration: [Debug, Release]
        include:
          - {toolset: vs2022, os: windows-2022}
    runs-on: '${{ matrix.os }}'
    name: 'Build: ${{ matrix.toolset }} / ${{ matrix.platform }} / ${{ matrix.configuration }}'
    defaults:
      run:
        shell: pwsh
    steps:
      - name: Checkout
        uses: actions/checkout@v6
        with:
          submodules: recursive
      - name: Set up msbuild
        uses: microsoft/setup-msbuild@v3
      - name: Build user-mode code
        run: |
          New-Item -Type Directory build\cmake | Out-Null
          cd build\cmake

          cmake -A '${{ matrix.platform }}' `
              '-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\build\install' `
              '${{ github.workspace }}'

          cmake --build . --target install --config '${{ matrix.configuration }}'
      - name: Build kernel-mode code
        run: |
          .\scripts\build.ps1 `
              -InstallDir build\install `
              -Configuration '${{ matrix.configuration }}' `
              -Platform '${{ matrix.platform }}' `
              -WDK wdk10
      - name: Run tests
        run: |
          .\scripts\test.ps1 -InstallDir build\install
      - name: Publish artifact
        uses: actions/upload-artifact@v7
        with:
          name: 'windows7-drivers-${{ matrix.platform }}-${{ matrix.configuration }}-Win10'
          path: ./build/install/
          if-no-files-found: error