-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (48 loc) · 1.82 KB
/
build.yaml
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
name: build
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0 # At 00:00 on Sunday.
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install Modules
shell: pwsh
run: |
Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force
Install-Module -Name PowerShell-Yaml -Scope CurrentUser -Force
Install-Module -Name Pester -Scope CurrentUser -Force
Get-InstalledModule -Name PSScriptAnalyzer,PowerShell-Yaml,Pester
- name: Run PSScriptAnalyzer
shell: pwsh
run: |
Invoke-ScriptAnalyzer -Path ./src -Settings ./PSScriptAnalyzerSettings.psd1 -Severity Warning
Invoke-ScriptAnalyzer -Path ./src/ScoopPlaybook.psm1 -Settings CodeFormatting
- uses: MinoruSekine/setup-scoop@main # use @main to fix. see https://github.com/MinoruSekine/setup-scoop/issues/7
- name: Scoop Version
run: scoop --version
- name: List Scoop Buckets
run: scoop bucket list
- name: Is scoop can install app?
run: scoop install yq
- name: List Scoop Apps
run: scoop list
- name: Run Unit Test
shell: pwsh
run: |
$PesterPreference = New-PesterConfiguration
# Show each test progress. https://pester.dev/docs/usage/output
$PesterPreference.Output.Verbosity = 'Detailed'
$PesterPreference.Output.StackTraceVerbosity = 'Full'
$PesterPreference.Output.CIFormat = 'GitHubActions'
# -CI option https://pester.dev/docs/commands/Invoke-Pester#-ci
$PesterPreference.TestResult.Enabled = $true
$PesterPreference.Run.Exit = $true
Invoke-Pester -Configuration $PesterPreference