Enable tests on Windows #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | ||
on: | ||
workflow_call: {} | ||
jobs: | ||
prepare: | ||
name: Find Tests 🔍 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tests: ${{ steps.tests.outputs.tests }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install Nix ❄️ | ||
uses: ./.github/actions/install-nix | ||
- name: Find Tests 🔍 | ||
id: tests | ||
run: | | ||
find tests -name '*.Tests.ps1' -print0 | perl -pe 's|(.*?)\x0|"\1",|g;s|,$||;s|(.*)|tests=[\1]|' >> $GITHUB_OUTPUT | ||
tests: | ||
name: Test (Docker) 🐳 | ||
needs: | ||
- prepare | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test: ${{ fromJSON(needs.prepare.outputs.tests) }} | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download Tarball 📥 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: tarball-test-docker | ||
- name: Execute Test 🧪 | ||
shell: pwsh | ||
run: | | ||
Invoke-Pester -Output Detailed ${{ matrix.test }} | ||
tests: | ||
name: Test (WSL) 🧪 | ||
needs: | ||
- prepare | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test: ${{ fromJSON(needs.prepare.outputs.tests) }} | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Download Tarball 📥 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: tarball-test-windows | ||
- name: Update WSL to enable support of WSL2 | ||
run: | | ||
wsl --update | ||
wsl --version | ||
- name: Execute Test 🧪 | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: | | ||
wsl dmesg -w & | ||
pwsh -c "Invoke-Pester -Output Detailed ${{ matrix.test }}" |