diff options
| author | David Spruill <[email protected]> | 2026-07-20 16:40:01 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-07-20 16:40:01 -0400 |
| commit | 6b4e5cc14c3a45aa5c51badb6bfe4886af30ad32 (patch) | |
| tree | 296afa9bd3722816f2390bb5e9eff27c6e75eb93 /.github/workflows | |
| parent | c5fc3ca1fd0e00a7e085ef48abfeff9c0c39817e (diff) | |
| parent | 15640356a5a6eeafefff403f6d287821213635cd (diff) | |
Merge branch 'develop' into user/daspr/kmodsamplefix
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/Code-Scanning.yml | 6 | ||||
| -rw-r--r-- | .github/workflows/check-sample-issue-template.yml | 50 | ||||
| -rw-r--r-- | .github/workflows/ci-pr.yml | 35 | ||||
| -rw-r--r-- | .github/workflows/ci.yml | 39 | ||||
| -rw-r--r-- | .github/workflows/tag-codeowner-on-issue.yml | 82 |
5 files changed, 200 insertions, 12 deletions
diff --git a/.github/workflows/Code-Scanning.yml b/.github/workflows/Code-Scanning.yml index 63e155c9..06346d21 100644 --- a/.github/workflows/Code-Scanning.yml +++ b/.github/workflows/Code-Scanning.yml @@ -26,7 +26,7 @@ on: jobs: analyze: name: Analysis - runs-on: windows-latest + runs-on: windows-2025-vs2026 permissions: actions: read contents: read @@ -48,7 +48,7 @@ jobs: run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Get changed files id: get-changed-files - uses: tj-actions/changed-files@v41 + uses: tj-actions/changed-files@v46 with: separator: "," - name: Initialize CodeQL @@ -66,7 +66,7 @@ jobs: WDS_Platform: x64 WDS_WipeOutputs: ${{ true }} - if: github.event_name == 'push' - run: .\Build-AllSamples.ps1 -Verbose -ThrottleLimit 1 + run: .\Build-Samples.ps1 -Verbose -ThrottleLimit 1 env: WDS_Configuration: Debug WDS_Platform: x64 diff --git a/.github/workflows/check-sample-issue-template.yml b/.github/workflows/check-sample-issue-template.yml new file mode 100644 index 00000000..7e17bedd --- /dev/null +++ b/.github/workflows/check-sample-issue-template.yml @@ -0,0 +1,50 @@ +name: Check Sample Issue Template + +on: + pull_request: + paths: + - '.github/CODEOWNERS' + - '.github/ISSUE_TEMPLATE/sample_issue.yml' + - '.github/ISSUE_TEMPLATE/sample_issue_generator.py' + + +jobs: + generate-template: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install pyyaml + + - name: Run the generator script + run: python .github/ISSUE_TEMPLATE/sample_issue_generator.py + + - name: Check for discrepancies + run: | + if git diff --quiet .github/ISSUE_TEMPLATE/sample_issue.yml; then + echo "✅ No discrepancies found. The sample issue template is up to date." + else + echo "❌ Discrepancy detected!" + echo "The CODEOWNERS file was modified, but the sample issue template is not up to date." + echo "" + echo "Please regenerate the sample issue template by running:" + echo " python .github/ISSUE_TEMPLATE/sample_issue_generator.py" + echo "" + echo "Or manually update it." + echo "" + echo "Then commit both files together:" + echo " git add .github/CODEOWNERS .github/ISSUE_TEMPLATE/sample_issue.yml" + echo " git commit -m 'Update CODEOWNERS and regenerate sample issue template'" + echo "" + echo "Differences found:" + git diff .github/ISSUE_TEMPLATE/sample_issue.yml + exit 1 + fi diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 0e5825d1..8119c94c 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -8,14 +8,40 @@ on: - '**.md' - 'LICENSE' jobs: + # Auto-discover the available _NT_TARGET_VERSION values from the active WDK so the build + # matrix never needs a hand-maintained version list. Change -Newest to build more/fewer. + discover: + name: discover _NT_TARGET_VERSIONs + runs-on: windows-2025-vs2026 + outputs: + versions: ${{ steps.nt.outputs.versions }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + + - name: Discover the newest _NT_TARGET_VERSION values + id: nt + shell: pwsh + run: | + $json = .\Get-NtTargetVersions.ps1 -Newest 4 -AsMatrixJson + "versions=$json" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + Write-Host "Discovered _NT_TARGET_VERSION matrix: $json" + build: - name: Build driver samples + name: build ${{ matrix.nt.tag }} ${{ matrix.configuration }} ${{ matrix.platform }} + needs: discover strategy: fail-fast: false matrix: configuration: [Debug, Release] platform: [x64, arm64] - runs-on: windows-2022 + # _NT_TARGET_VERSION values are auto-discovered by the 'discover' job from the active + # WDK, so there is no version list to maintain here. + nt: ${{ fromJSON(needs.discover.outputs.versions) }} + runs-on: windows-2025-vs2026 steps: - name: Check out repository code uses: actions/checkout@v4 @@ -38,13 +64,14 @@ jobs: env: WDS_Configuration: ${{ matrix.configuration }} WDS_Platform: ${{ matrix.platform }} - WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} + WDS_NtTargetVersion: ${{ matrix.nt.version }} + WDS_ReportFileName: _overview.${{ matrix.nt.tag }}.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports uses: actions/upload-artifact@v4 if: always() with: - name: logs-${{ matrix.configuration }}-${{ matrix.platform }} + name: logs-${{ matrix.nt.tag }}-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f3d7693..4b263a82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,7 @@ name: Build all driver samples on: + # Allows the workflow to be triggered manually from the Actions tab ("Run workflow"). + workflow_dispatch: push: branches: - main @@ -11,14 +13,40 @@ on: # Runs every Saturday at 00:00 PST (08:00 UTC) - cron: '0 8 * * 6' jobs: + # Auto-discover the available _NT_TARGET_VERSION values from the active WDK so the build + # matrix never needs a hand-maintained version list. Change -Newest to build more/fewer. + discover: + name: discover _NT_TARGET_VERSIONs + runs-on: windows-2025-vs2026 + outputs: + versions: ${{ steps.nt.outputs.versions }} + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + - name: Install Nuget Packages + run: nuget restore .\packages.config -PackagesDirectory .\packages\ + + - name: Discover the newest _NT_TARGET_VERSION values + id: nt + shell: pwsh + run: | + $json = .\Get-NtTargetVersions.ps1 -Newest 4 -AsMatrixJson + "versions=$json" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + Write-Host "Discovered _NT_TARGET_VERSION matrix: $json" + build: - name: Build driver samples + name: build ${{ matrix.nt.tag }} ${{ matrix.configuration }} ${{ matrix.platform }} + needs: discover strategy: fail-fast: false matrix: configuration: [Debug, Release] platform: [x64, arm64] - runs-on: windows-2022 + # _NT_TARGET_VERSION values are auto-discovered by the 'discover' job from the active + # WDK, so there is no version list to maintain here. + nt: ${{ fromJSON(needs.discover.outputs.versions) }} + runs-on: windows-2025-vs2026 steps: - name: Check out repository code uses: actions/checkout@v4 @@ -29,17 +57,18 @@ jobs: run: nuget restore .\packages.config -PackagesDirectory .\packages\ - name: Retrieve and build all available solutions - run: .\Build-AllSamples.ps1 -Verbose + run: .\Build-Samples.ps1 -Verbose env: WDS_Configuration: ${{ matrix.configuration }} WDS_Platform: ${{ matrix.platform }} - WDS_ReportFileName: _overview.${{ matrix.configuration }}.${{ matrix.platform }} + WDS_NtTargetVersion: ${{ matrix.nt.version }} + WDS_ReportFileName: _overview.${{ matrix.nt.tag }}.${{ matrix.configuration }}.${{ matrix.platform }} - name: Archive build logs and overview build reports uses: actions/upload-artifact@v4 if: always() with: - name: logs-${{ matrix.configuration }}-${{ matrix.platform }} + name: logs-${{ matrix.nt.tag }}-${{ matrix.configuration }}-${{ matrix.platform }} path: _logs report: diff --git a/.github/workflows/tag-codeowner-on-issue.yml b/.github/workflows/tag-codeowner-on-issue.yml new file mode 100644 index 00000000..a4fe365d --- /dev/null +++ b/.github/workflows/tag-codeowner-on-issue.yml @@ -0,0 +1,82 @@ +name: Tag Codeowner on Sample Issue + +on: + issues: + types: [opened] + +jobs: + tag-codeowner: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install pyyaml requests + + - name: Extract selected path and tag codeowner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ISSUE_BODY: ${{ github.event.issue.body }} + ISSUE_NUMBER: ${{ github.event.issue.number }} + run: | + python3 - <<EOF + import os + import re + import requests + + issue_body = os.environ['ISSUE_BODY'] + selected_path = None + + # Try to extract the selected path from the issue body + match = re.search(r'### Which is the area where the sample lives\?\s*\n(.+)', issue_body, re.MULTILINE) + if match: + selected_path = match.group(1).strip() + + if not selected_path: + print("No sample path found in issue body.") + exit(0) + + # Read CODEOWNERS + with open(".github/CODEOWNERS", "r") as f: + lines = f.readlines() + + codeowner = None + sample_section = False + for line in lines: + line = line.strip() + if line.startswith("# Samples"): + sample_section = True + continue + if sample_section: + if line.startswith("#") or not line: + continue + path, owner = line.split() + if path == selected_path: + codeowner = owner + break + + if codeowner is None: + print(f"No codeowner found for path: {selected_path}") + exit(0) + + # Post a comment tagging the owner + comment = f"{codeowner} can you please take a look at this issue related to {selected_path}?" + repo = os.environ['GITHUB_REPOSITORY'] + token = os.environ['GITHUB_TOKEN'] + issue_number = os.environ['ISSUE_NUMBER'] + + url = f"https://api.github.com/repos/{repo}/issues/{issue_number}/comments" + headers = { + "Authorization": f"Bearer {token}", + "Accept": "application/vnd.github.v3+json" + } + response = requests.post(url, headers=headers, json={"body": comment}) + print("Comment posted:", response.status_code, response.text) + EOF |
