-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.48 KB
/
Test.yml
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:
workflow_dispatch:
push:
tags:
- v*
branches:
- main
paths-ignore:
- .github/workflows/Docs.yml
- .github/workflows/NotifyOnStarred.yml
- .github/workflows/Publish.yml
pull_request:
branches:
- main
paths-ignore:
- .github/workflows/Docs.yml
- .github/workflows/Publish.yml
jobs:
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
key: ${{ runner.os }}
path: .cache
- name: Load PSDepend Requirements
id: psdepend
shell: pwsh
run: |
$reqs = Import-PowerShellDataFile ./requirements.psd1
$moduleNames = $reqs.Keys | Where-Object { $_ -ne 'PSDependOptions' -and $null -eq $reqs[$_].DependencyType }
$dependencyList = ($moduleNames | Sort-Object | ForEach-Object { '{0}:{1}' -f $_, $reqs[$_].Version }) -join ', '
"psdependencies=$dependencyList" >> $env:GITHUB_OUTPUT
- name: Install and cache PowerShell modules
uses: potatoqualitee/psmodulecache@v6.0
with:
modules-to-cache: ${{ steps.psdepend.outputs.psdependencies }}
- name: Test
shell: pwsh
run: ./build.ps1 -Task Test -Bootstrap