-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (81 loc) · 2.46 KB
/
ModuleCI.yml
File metadata and controls
82 lines (81 loc) · 2.46 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
name: CI
on:
workflow_call:
permissions:
checks: write
pull-requests: write
contents: read
issues: write
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:
name: Run Pwsh Tests
# We still have the azure pipeline setup that's running windows
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
- 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 (Windows PowerShell 5.1)
# Windows PowerShell 5.1 (Desktop) is not a runner OS, so it is run as a
# separate job using the built-in `powershell` shell on windows-latest.
# Modules that declare Windows PowerShell (Desktop) support must build and
# test cleanly on the lowest supported engine, not just PowerShell 7+.
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@v4
with:
name: Unit Test Results (Windows PowerShell 5.1)
path: ./tests/out/testResults.xml
publish-test-results:
name: "Publish Unit Tests Results"
needs:
- test
- test_powershell
runs-on: ubuntu-latest
# Publish whenever the test jobs ran (pass or fail); only skip if the
# workflow itself was cancelled.
if: ${{ !cancelled() }}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.xml