mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add merge conflict marker detection to linux-ci workflow and refactor existing actions to use reusable get-changed-files action (#26350)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: TravisEz13 <10873629+TravisEz13@users.noreply.github.com> Co-authored-by: Travis Plunk <travis.plunk@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Travis Plunk (HE/HIM) <tplunk@ntdev.microsoft.com>
This commit is contained in:
co-authored by
TravisEz13
Travis Plunk
Copilot
Travis Plunk
parent
c12322323d
commit
0c40a84abb
@@ -67,6 +67,20 @@ jobs:
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
merge_conflict_check:
|
||||
name: Check for Merge Conflict Markers
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'pull_request' && (startsWith(github.repository_owner, 'azure') || github.repository_owner == 'PowerShell')
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Check for merge conflict markers
|
||||
uses: "./.github/actions/infrastructure/merge-conflict-checker"
|
||||
|
||||
ci_build:
|
||||
name: Build PowerShell
|
||||
runs-on: ubuntu-latest
|
||||
@@ -158,6 +172,48 @@ jobs:
|
||||
runner_os: ubuntu-latest
|
||||
test_results_artifact_name: testResults-xunit
|
||||
|
||||
infrastructure_tests:
|
||||
name: Infrastructure Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Install Pester
|
||||
shell: pwsh
|
||||
run: |
|
||||
Import-Module ./tools/ci.psm1
|
||||
Install-CIPester
|
||||
|
||||
- name: Run Infrastructure Tests
|
||||
shell: pwsh
|
||||
run: |
|
||||
$testResultsFolder = Join-Path $PWD "testResults"
|
||||
New-Item -ItemType Directory -Path $testResultsFolder -Force | Out-Null
|
||||
|
||||
$config = New-PesterConfiguration
|
||||
$config.Run.Path = './test/infrastructure/'
|
||||
$config.Run.PassThru = $true
|
||||
$config.TestResult.Enabled = $true
|
||||
$config.TestResult.OutputFormat = 'NUnitXml'
|
||||
$config.TestResult.OutputPath = "$testResultsFolder/InfrastructureTests.xml"
|
||||
$config.Output.Verbosity = 'Detailed'
|
||||
|
||||
$result = Invoke-Pester -Configuration $config
|
||||
|
||||
if ($result.FailedCount -gt 0 -or $result.Result -eq 'Failed') {
|
||||
throw "Infrastructure tests failed"
|
||||
}
|
||||
|
||||
- name: Publish Test Results
|
||||
uses: "./.github/actions/test/process-pester-results"
|
||||
if: always()
|
||||
with:
|
||||
name: "InfrastructureTests"
|
||||
testResultsFolder: "${{ github.workspace }}/testResults"
|
||||
|
||||
## Temporarily disable the CodeQL analysis on Linux as it doesn't work for .NET SDK 10-rc.2.
|
||||
# analyze:
|
||||
# name: CodeQL Analysis
|
||||
@@ -180,6 +236,8 @@ jobs:
|
||||
- linux_test_unelevated_ci
|
||||
- linux_test_unelevated_others
|
||||
- linux_packaging
|
||||
- merge_conflict_check
|
||||
- infrastructure_tests
|
||||
# - analyze
|
||||
if: always()
|
||||
uses: PowerShell/compliance/.github/workflows/ready-to-merge.yml@v1.0.0
|
||||
|
||||
@@ -187,6 +187,14 @@ jobs:
|
||||
$macOSRuntime = if ([System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') { 'osx-arm64' } else { 'osx-x64' }
|
||||
Start-PSPackage -Type osxpkg -ReleaseTag $releaseTag -MacOSRuntime $macOSRuntime -SkipReleaseChecks
|
||||
shell: pwsh
|
||||
|
||||
- name: Install Pester
|
||||
if: success()
|
||||
run: |-
|
||||
Import-Module ./tools/ci.psm1
|
||||
Install-CIPester
|
||||
shell: pwsh
|
||||
|
||||
- name: Test package contents
|
||||
if: success()
|
||||
run: |-
|
||||
|
||||
Reference in New Issue
Block a user