Skip to content

Commit d815ec2

Browse files
authored
Create tests.yml WorkFlow
1 parent 8c2dd20 commit d815ec2

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
defaults:
13+
run:
14+
shell: pwsh
15+
16+
jobs:
17+
Tests:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: 📥 Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: 📦 Install ModuleTools module form PSGallery
24+
run: Install-PSResource -Repository PSGallery -Name ModuleTools -TrustRepository
25+
26+
- name: 📦 Install SqlQueryClass module form PSGallery
27+
run: Install-PSResource -Repository PSGallery -Name SqlQueryClass -TrustRepository
28+
29+
- name: 🏗️ Build Module
30+
run: Invoke-MTBuild -Verbose
31+
32+
- name: 🧪 Run Pester Tests
33+
run: Invoke-MTTest
34+
35+
- name: 📝 Generate Report
36+
continue-on-error: true
37+
run: |
38+
# Get list of files in the dist directory directory
39+
$Report = New-MDHeader -Text "Output Files 📁" -Level 2
40+
$Report += Get-ChildItem -Path ./dist -Recurse | Select-Object Name, Directory | New-MDTable
41+
echo "$Report" >> $env:GITHUB_STEP_SUMMARY
42+
echo "$Report"

0 commit comments

Comments
 (0)