Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7ad1286
Add support for `github-mirror` branch in CI workflow and update cond…
TravisEz13 Mar 25, 2025
49551cf
Add GitHub token to checkout step in Linux CI workflow
TravisEz13 Mar 25, 2025
c2df067
Update Linux CI workflow to disable credential persistence during che…
TravisEz13 Mar 25, 2025
68d5b69
Add read permission for contents in Linux CI workflow
TravisEz13 Mar 25, 2025
475131c
Remove unnecessary conditional check for repository owner in Linux CI…
TravisEz13 Mar 25, 2025
05812d9
Update GitHub test reporter action to a specific commit version
TravisEz13 Mar 25, 2025
781152c
Add conditional check for repository owner in test report action
TravisEz13 Mar 26, 2025
53c58c9
Add conditional check for repository owner in Linux CI workflow
TravisEz13 Mar 26, 2025
dd1d565
Add GitHub Actions error logging to Write-Log function
TravisEz13 Mar 26, 2025
dbea97e
Add summary logging for Pester test results in GitHub Actions
TravisEz13 Mar 26, 2025
212e376
Add conditional check for repository owner in Pester results publishi…
TravisEz13 Mar 26, 2025
be38927
Remove JUnit to CTRF conversion and test report publishing steps for …
TravisEz13 Mar 26, 2025
98bbcc2
Add GitHub Actions filter to check for changes in workflows, actions,…
TravisEz13 Mar 26, 2025
167709c
Refactor conditional checks in Linux CI workflow to remove repository…
TravisEz13 Mar 27, 2025
b806844
Add path filters action for change detection in workflows
TravisEz13 Mar 27, 2025
749541c
Add GITHUB_TOKEN input to path filters action for improved token hand…
TravisEz13 Apr 2, 2025
c49a6da
Add culture setup and capture steps to CI workflow for localization s…
TravisEz13 Apr 2, 2025
f9fba9b
Remove culture setting logic for non-en-US locales in Nix action
TravisEz13 Apr 2, 2025
4532351
Add support for Ubuntu 22.04 and 24.04 in environment detection; enha…
TravisEz13 Apr 2, 2025
baa19ef
Enhance logging in Nix action by adding log group starts and ends for…
TravisEz13 Apr 2, 2025
dc2c09f
Add support for 'github-mirror' branch in CI workflows for macOS and …
TravisEz13 Apr 2, 2025
427217b
Add 'contents' permission to CI workflows for macOS and Windows
TravisEz13 Apr 2, 2025
c1cbe96
Refactor module import statements in Nix action to remove unnecessary…
TravisEz13 Apr 2, 2025
9d938b6
Add validation for GITHUB_STEP_SUMMARY in process-pester-results action
TravisEz13 Apr 3, 2025
c8fcfbc
Merge branch 'master' into fix-azure-gh-actions
TravisEz13 Apr 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/actions/infrastructure/path-filters/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Path Filters
description: 'Path Filters'
inputs:
GITHUB_TOKEN:
description: 'GitHub token'
required: true
outputs:
source:
description: 'Source code changes (composite of all changes)'
value: ${{ steps.filter.outputs.source }}
githubChanged:
description: 'GitHub workflow changes'
value: ${{ steps.filter.outputs.githubChanged }}
toolsChanged:
description: 'Tools changes'
value: ${{ steps.filter.outputs.toolsChanged }}
propsChanged:
description: 'Props changes'
value: ${{ steps.filter.outputs.propsChanged }}
testsChanged:
description: 'Tests changes'
value: ${{ steps.filter.outputs.testsChanged }}
mainSourceChanged:
description: 'Main source code changes (any changes in src/)'
value: ${{ steps.filter.outputs.mainSourceChanged }}
buildModuleChanged:
description: 'Build module changes'
value: ${{ steps.filter.outputs.buildModuleChanged }}
runs:
using: composite
steps:
- name: Check if GitHubWorkflowChanges is present
id: filter
uses: actions/[email protected]
with:
github-token: ${{ inputs.GITHUB_TOKEN }}
script: |
// Fetch the list of files changed in the PR
let files = [];
let page = 1;
let fetchedFiles;
do {
fetchedFiles = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
per_page: 100,
page: page++
});
files = files.concat(fetchedFiles.data);
} while (fetchedFiles.data.length > 0);

const actionsChanged = files.some(file => file.filename.startsWith('.github/actions'));
const workflowsChanged = files.some(file => file.filename.startsWith('.github/workflows'));
const githubChanged = actionsChanged || workflowsChanged;

const toolsCiPsm1Changed = files.some(file => file.filename.startsWith('tools/ci.psm1'));
const toolsBuildCommonChanged = files.some(file => file.filename.startsWith('tools/buildCommon/'));
const toolsChanged = toolsCiPsm1Changed || toolsBuildCommonChanged;

const propsChanged = files.some(file => file.filename.endsWith('.props'));

const testsChanged = files.some(file => file.filename.startsWith('test/powershell/') || file.filename.startsWith('test/tools/') || file.filename.startsWith('test/xUnit/'));

const mainSourceChanged = files.some(file => file.filename.startsWith('src/'));

const buildModuleChanged = files.some(file => file.filename.startsWith('build.psm1'));

const source = mainSourceChanged || toolsChanged || githubChanged || propsChanged || testsChanged;

core.setOutput('toolsChanged', toolsChanged);
core.setOutput('githubChanged', githubChanged);
core.setOutput('propsChanged', propsChanged);
core.setOutput('testsChanged', testsChanged);
core.setOutput('mainSourceChanged', mainSourceChanged);
core.setOutput('buildModuleChanged', buildModuleChanged);
core.setOutput('source', source);

- name: Capture outputs
run: |
Write-Verbose -Verbose "source: ${{ steps.filter.outputs.source }}"
Write-Verbose -Verbose "github: ${{ steps.filter.outputs.githubChanged }}"
Write-Verbose -Verbose "tools: ${{ steps.filter.outputs.toolsChanged }}"
Write-Verbose -Verbose "props: ${{ steps.filter.outputs.propsChanged }}"
Write-Verbose -Verbose "tests: ${{ steps.filter.outputs.testsChanged }}"
Write-Verbose -Verbose "mainSource: ${{ steps.filter.outputs.mainSourceChanged }}"
Write-Verbose -Verbose "buildModule: ${{ steps.filter.outputs.buildModuleChanged }}"
shell: pwsh
27 changes: 22 additions & 5 deletions .github/actions/test/nix/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,39 @@ runs:
steps:
- name: Capture Environment
if: success() || failure()
run: 'Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose'
run: |-
Import-Module ./build.psm1
Write-LogGroupStart -Title 'Environment'
Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
Write-LogGroupEnd -Title 'Environment'
shell: pwsh

- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
path: "${{ github.workspace }}"

- name: Capture Artifacts Directory
continue-on-error: true
run: Get-ChildItem "${{ github.workspace }}/build/*" -Recurse
run: |-
Import-Module ./build.psm1
Write-LogGroupStart -Title 'Artifacts Directory'
Get-ChildItem "${{ github.workspace }}/build/*" -Recurse
Write-LogGroupEnd -Title 'Artifacts Directory'
shell: pwsh

- uses: actions/setup-dotnet@v4
with:
global-json-file: ./global.json

- name: Bootstrap
shell: pwsh
run: |-
Import-Module ./build.psm1
Write-LogGroupStart -Title 'Bootstrap'
Import-Module ./tools/ci.psm1
Invoke-CIInstall -SkipUser
Write-LogGroupEnd -Title 'Bootstrap'

- name: Extract Files
uses: actions/[email protected]
Expand Down Expand Up @@ -68,7 +81,11 @@ runs:

- name: Capture Extracted Build ZIP
continue-on-error: true
run: Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue
run: |-
Import-Module ./build.psm1
Write-LogGroupStart -Title 'Extracted Build ZIP'
Get-ChildItem "${{ github.workspace }}/bins/*" -Recurse -ErrorAction SilentlyContinue
Write-LogGroupEnd -Title 'Extracted Build ZIP'
shell: pwsh

- name: Test
Expand Down
64 changes: 30 additions & 34 deletions .github/actions/test/process-pester-results/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,43 @@ inputs:
runs:
using: composite
steps:
- name: Convert JUnit to CTRF
run: |-
- name: Log Summary
run: |
if (-not $env:GITHUB_STEP_SUMMARY) {
Write-Error "GITHUB_STEP_SUMMARY is not set. Ensure this workflow is running in a GitHub Actions environment."
exit 1
}

$testCaseCount = 0
$testErrorCount = 0
$testFailureCount = 0
$testDisabledCount = 0
Get-ChildItem -Path "${{ inputs.testResultsFolder }}/*.xml" -Recurse | ForEach-Object {
npx --yes junit-to-ctrf $_.FullName --output ./${{ inputs.ctrfFolder }}/$($_.BaseName).json --tool Pester
$results = [xml] (get-content $_.FullName)
$testCaseCount += $results.testsuites.tests
$testErrorCount += $results.testsuites.errors
$testFailureCount += $results.testsuites.failures
$testDisabledCount += $results.testsuites.disabled
}
shell: pwsh

# this task only takes / as directory separators
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@v1
with:
report-path: './${{ inputs.ctrfFolder }}/*.json'
exit-on-fail: true
summary-report: true
test-report: false
test-list-report: false
failed-report: false
fail-rate-report: false
flaky-report: false
flaky-rate-report: false
failed-folded-report: true
previous-results-report: false
ai-report: true
skipped-report: false
suite-folded-report: false
suite-list-report: false
pull-request-report: false
commit-report: false
custom-report: false
if: always()
@"

# Summary of ${{ inputs.name }}

- Total Tests: $testCaseCount
- Total Errors: $testErrorCount
- Total Failures: $testFailureCount
- Total Disabled: $testDisabledCount

"@ | Out-File -FilePath $ENV:GITHUB_STEP_SUMMARY -Append

Write-Host "Summary written to $ENV:GITHUB_STEP_SUMMARY"
Get-Content $ENV:GITHUB_STEP_SUMMARY
shell: pwsh

- name: Upload testResults artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: junit-pester-${{ inputs.name }}
path: ${{ runner.workspace }}/testResults

- name: Upload ctrf artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ctrf-pester-${{ inputs.name }}
path: ${{ inputs.ctrfFolder }}
24 changes: 9 additions & 15 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- master
- release/**
- github-mirror
paths:
- "**"
- "!.github/ISSUE_TEMPLATE/**"
Expand All @@ -19,6 +20,7 @@ on:
branches:
- master
- release/**
- github-mirror
# Path filters for PRs need to go into the changes job

concurrency:
Expand All @@ -43,30 +45,22 @@ jobs:
# Required permissions
permissions:
pull-requests: read
contents: read

# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.source }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
persist-credentials: false

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0
- name: Change Detection
id: filter
uses: "./.github/actions/infrastructure/path-filters"
with:
list-files: json
filters: .github/action-filters.yml

- name: Capture outputs
run: |
"source: ${{ steps.filter.outputs.source }}"
"github: ${{ steps.filter.outputs.github }}"
"tools: ${{ steps.filter.outputs.tools }}"
"props: ${{ steps.filter.outputs.props }}"
"tests: ${{ steps.filter.outputs.tests }}"
"mainSource: ${{ steps.filter.outputs.mainSource }}"
"buildModule: ${{ steps.filter.outputs.buildModule }}"
shell: pwsh
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ci_build:
name: Build PowerShell
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- master
- release/**
- github-mirror
paths:
- "**"
- "!.github/ISSUE_TEMPLATE/**"
Expand All @@ -17,6 +18,7 @@ on:
branches:
- master
- release/**
- github-mirror
# Path filters for PRs need to go into the changes job

concurrency:
Expand All @@ -34,6 +36,7 @@ env:
__SuppressAnsiEscapeSequences: 1
nugetMultiFeedWarnLevel: none
system_debug: 'false'

jobs:
changes:
name: Change Detection
Expand All @@ -42,30 +45,20 @@ jobs:
# Required permissions
permissions:
pull-requests: read
contents: read

# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.source }}
steps:
- name: checkout
uses: actions/checkout@v4

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0
- name: Change Detection
id: filter
uses: "./.github/actions/infrastructure/path-filters"
with:
list-files: json
filters: .github/action-filters.yml

- name: Capture outputs
run: |
"source: ${{ steps.filter.outputs.source }}"
"github: ${{ steps.filter.outputs.github }}"
"tools: ${{ steps.filter.outputs.tools }}"
"props: ${{ steps.filter.outputs.props }}"
"tests: ${{ steps.filter.outputs.tests }}"
"mainSource: ${{ steps.filter.outputs.mainSource }}"
"buildModule: ${{ steps.filter.outputs.buildModule }}"
shell: pwsh
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ci_build:
name: Build PowerShell
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/windows-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- release/**
- github-mirror
paths:
- "**"
- "!.vsts-ci/misc-analysis.yml"
Expand All @@ -16,6 +17,8 @@ on:
branches:
- master
- release/**
- github-mirror

# Path filters for PRs need to go into the changes job

concurrency:
Expand Down Expand Up @@ -43,30 +46,20 @@ jobs:
# Required permissions
permissions:
pull-requests: read
contents: read

# Set job outputs to values from filter step
outputs:
source: ${{ steps.filter.outputs.source }}
steps:
- name: checkout
uses: actions/checkout@v4

# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.2.0
- name: Change Detection
id: filter
uses: "./.github/actions/infrastructure/path-filters"
with:
list-files: json
filters: .github/action-filters.yml

- name: Capture outputs
run: |
"source: ${{ steps.filter.outputs.source }}"
"github: ${{ steps.filter.outputs.github }}"
"tools: ${{ steps.filter.outputs.tools }}"
"props: ${{ steps.filter.outputs.props }}"
"tests: ${{ steps.filter.outputs.tests }}"
"mainSource: ${{ steps.filter.outputs.mainSource }}"
"buildModule: ${{ steps.filter.outputs.buildModule }}"
shell: pwsh
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ci_build:
name: Build PowerShell
Expand Down
Loading
Loading