mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com>
195 lines
6.0 KiB
YAML
195 lines
6.0 KiB
YAML
name: Windows-CI
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
- github-mirror
|
|
paths:
|
|
- "**"
|
|
- "*"
|
|
- ".globalconfig"
|
|
- "!.vsts-ci/misc-analysis.yml"
|
|
- "!.github/ISSUE_TEMPLATE/**"
|
|
- "!.dependabot/config.yml"
|
|
- "!test/perf/**"
|
|
- "!.pipelines/**"
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
- github-mirror
|
|
- "*-feature"
|
|
|
|
# Path filters for PRs need to go into the changes job
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ contains(github.ref, 'merge')}}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
run-name: "${{ github.ref_name }} - ${{ github.run_number }}"
|
|
|
|
env:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
DOTNET_NOLOGO: 1
|
|
GIT_CONFIG_PARAMETERS: "'core.autocrlf=false'"
|
|
NugetSecurityAnalysisWarningLevel: none
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
__SuppressAnsiEscapeSequences: 1
|
|
nugetMultiFeedWarnLevel: none
|
|
SYSTEM_ARTIFACTSDIRECTORY: ${{ github.workspace }}/artifacts
|
|
BUILD_ARTIFACTSTAGINGDIRECTORY: ${{ github.workspace }}/artifacts
|
|
jobs:
|
|
changes:
|
|
name: Change Detection
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell'
|
|
# Required permissions
|
|
permissions:
|
|
pull-requests: read
|
|
contents: read
|
|
|
|
# Set job outputs to values from filter step
|
|
outputs:
|
|
source: ${{ steps.filter.outputs.source }}
|
|
buildModuleChanged: ${{ steps.filter.outputs.buildModuleChanged }}
|
|
packagingChanged: ${{ steps.filter.outputs.packagingChanged }}
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Change Detection
|
|
id: filter
|
|
uses: "./.github/actions/infrastructure/path-filters"
|
|
with:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
ci_build:
|
|
name: Build PowerShell
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1000
|
|
- name: Build
|
|
uses: "./.github/actions/build/ci"
|
|
windows_test_unelevated_ci:
|
|
name: Windows Unelevated CI
|
|
needs:
|
|
- ci_build
|
|
- changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1000
|
|
- name: Windows Unelevated CI
|
|
uses: "./.github/actions/test/windows"
|
|
with:
|
|
purpose: UnelevatedPesterTests
|
|
tagSet: CI
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
windows_test_elevated_ci:
|
|
name: Windows Elevated CI
|
|
needs:
|
|
- ci_build
|
|
- changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1000
|
|
- name: Windows Elevated CI
|
|
uses: "./.github/actions/test/windows"
|
|
with:
|
|
purpose: ElevatedPesterTests
|
|
tagSet: CI
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
windows_test_unelevated_others:
|
|
name: Windows Unelevated Others
|
|
needs:
|
|
- ci_build
|
|
- changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1000
|
|
- name: Windows Unelevated Others
|
|
uses: "./.github/actions/test/windows"
|
|
with:
|
|
purpose: UnelevatedPesterTests
|
|
tagSet: Others
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
windows_test_elevated_others:
|
|
name: Windows Elevated Others
|
|
needs:
|
|
- ci_build
|
|
- changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 1000
|
|
- name: Windows Elevated Others
|
|
uses: "./.github/actions/test/windows"
|
|
with:
|
|
purpose: ElevatedPesterTests
|
|
tagSet: Others
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
xunit_tests:
|
|
name: xUnit Tests
|
|
needs:
|
|
- changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
uses: ./.github/workflows/xunit-tests.yml
|
|
with:
|
|
runner_os: windows-latest
|
|
test_results_artifact_name: testResults-xunit
|
|
analyze:
|
|
name: CodeQL Analysis
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.source == 'true' || needs.changes.outputs.buildModuleChanged == 'true' }}
|
|
uses: ./.github/workflows/analyze-reusable.yml
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
security-events: write
|
|
with:
|
|
runner_os: windows-latest
|
|
windows_packaging:
|
|
name: Windows Packaging
|
|
needs:
|
|
- changes
|
|
if: ${{ needs.changes.outputs.packagingChanged == 'true' }}
|
|
uses: ./.github/workflows/windows-packaging-reusable.yml
|
|
ready_to_merge:
|
|
name: windows ready to merge
|
|
needs:
|
|
- xunit_tests
|
|
- windows_test_elevated_ci
|
|
- windows_test_elevated_others
|
|
- windows_test_unelevated_ci
|
|
- windows_test_unelevated_others
|
|
- analyze
|
|
- windows_packaging
|
|
if: always()
|
|
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@c8b3ad5819ad7078f3e375519b4f8c6232d1cbdf # v1.0.0
|
|
with:
|
|
needs_context: ${{ toJson(needs) }}
|