-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (79 loc) · 2.3 KB
/
powershell-ci.yml
File metadata and controls
85 lines (79 loc) · 2.3 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
name: PowerShell CI
# Reusable workflow. Call from a consuming repo:
#
# jobs:
# ci:
# uses: PowerShellOrg/.github/.github/workflows/powershell-ci.yml@main
#
# Task names are fixed convention across all PowerShellOrg repos:
# Init, Clean, Build, Test, Analyze, Publish
# See the org wiki for psake task naming requirements.
on:
workflow_call: {}
jobs:
lint:
name: Run Linters
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v6
with:
strict: false
suggestions: true
incremental_files_only: true
- shell: pwsh
name: Apply PSScriptAnalyzer Fixes
run: Invoke-ScriptAnalyzer . -Fix
- name: PSScriptAnalyzer Fixes
uses: reviewdog/action-suggester@v1.21.0
with:
tool_name: "PSScriptAnalyzer"
test_pwsh:
name: Run Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v6
- name: Test
shell: pwsh
run: ./build.ps1 -Task Test -Bootstrap
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Unit Test Results (OS ${{ matrix.os }})
path: ./tests/out/testResults.xml
test_powershell:
name: Run Tests (PowerShell 5.1)
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Test
shell: powershell
run: ./build.ps1 -Task Test -Bootstrap
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v7
with:
name: Unit Test Results (OS Windows PowerShell 5.1)
path: ./tests/out/testResults.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs:
- test_pwsh
- test_powershell
runs-on: ubuntu-latest
# the test job might be skipped, we don't need to run this job then
if: success() || failure()
steps:
- name: Download Artifacts
uses: actions/download-artifact@v7
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml