Skip to content

Fix predictor path synchronization and enhance thread safety #22

Fix predictor path synchronization and enhance thread safety

Fix predictor path synchronization and enhance thread safety #22

Workflow file for this run

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: 8.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