-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.24 KB
/
Copy pathpester.yml
File metadata and controls
49 lines (42 loc) · 1.24 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
name: PowerCat CI/CD
on:
push:
branches: [ "main" ]
tags:
- 'v*.*.*'
pull_request:
branches: [ "main" ]
jobs:
test:
name: Run Pester Tests
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Install Pester
shell: pwsh
run: Install-Module Pester -Force -Scope CurrentUser
- name: Run Pester tests
shell: pwsh
run: |
Import-Module -Name Pester -Force
$config = New-PesterConfiguration
$config.Run.Path = "tests"
$config.Output.Verbosity = "Detailed"
Invoke-Pester -Configuration $config
publish:
name: Publish to PSGallery
needs: test
runs-on: windows-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Validate module manifest
shell: pwsh
run: Test-ModuleManifest -Path .\src\PowerCat\PowerCat.psd1
- name: Publish module to PSGallery
shell: pwsh
run: Publish-Module -Path .\src\PowerCat -NuGetApiKey $env:PSGALLERY_KEY -Verbose
env:
PSGALLERY_KEY: ${{ secrets.PSGALLERY_KEY }}