-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (47 loc) 路 1.44 KB
/
Copy pathtest.yml
File metadata and controls
55 lines (47 loc) 路 1.44 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
name: Test
on:
push:
branches: ["main"]
paths:
- "Module/**"
- "Predictor/**"
- "Build.ps1"
pull_request:
branches: ["main"]
jobs:
test:
name: Pester test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout Repository Code
uses: actions/checkout@v6
with:
fetch-depth: 1 # Fetch only the latest commit to speed up the checkout process
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Build Module
shell: pwsh
run: ./Build.ps1 -Configuration Release
- name: Create Config Directory and File (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p ~/.local/share/PSFavorite
echo '' > ~/.local/share/PSFavorite/Favorites.txt
- name: Create Config Directory and File (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$configPath = "$env:LOCALAPPDATA\PSFavorite"
New-Item -ItemType Directory -Path $configPath -Force | Out-Null
New-Item -ItemType File -Path "$configPath\Favorites.txt" -Force | Out-Null
- name: Run Tests
shell: pwsh
run: |
Import-Module ./Module/PSFavorite.psd1 -Force
Invoke-Pester -Path ./Module/Tests -Output Detailed -PassThru