Dynamically Determine which Modules for psmodulecache #31
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: CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: GetDependancies | |
id: getdepends | |
shell: pwsh | |
run: | | |
$d = (Import-PowerShellDataFile .\requirements.psd1).GetEnumerator() | Where-Object { $_.Name -ne 'PSDependOptions'} | |
$output = ($d | ForEach-Object { "{0}:{1}" -F $_.Name, $_.Value.Version}) -join ' ' | |
Write-Host "::set-output name=modules-to-cache::$output" | |
- name: Install and cache PowerShell modules | |
id: psmodulecache | |
uses: potatoqualitee/psmodulecache@v4.5 | |
with: | |
modules-to-cache: steps.getdepends.outputs.modules-to-cache | |
shell: pwsh | |
- name: Test | |
shell: pwsh | |
run: ./build.ps1 -Task Test -Bootstrap | |
- name: Upload Unit Test Results | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Unit Test Results (OS ${{ matrix.os }}) | |
path: ./tests/out/testResults.xml | |
publish-test-results: | |
name: "Publish Unit Tests Results" | |
needs: test | |
runs-on: ubuntu-latest | |
# the test job might be skipped, we don't need to run this job then | |
if: success() || failure() | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: Publish Unit Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v1 | |
with: | |
files: artifacts/**/*.xml |