Package type inspection support #59
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
# This is a basic workflow to help you get started with Actions | |
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup PowerShell module cache | |
uses: actions/cache@v3 | |
id: cacher | |
with: | |
path: "~/.local/share/powershell/Modules" | |
key: crescendo-1.1.0-cache | |
- name: Install Crescendo | |
if: steps.cacher.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: Install-Module Microsoft.PowerShell.Crescendo -RequiredVersion 1.1.0 -Force | |
- name: Build the module with Crescendo | |
shell: pwsh | |
run: ./build.ps1 | |
- name: Bundle up module | |
uses: actions/upload-artifact@v3 | |
with: | |
name: module | |
path: ./src/ | |
Test: | |
needs: Build | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Download module | |
uses: actions/download-artifact@v3 | |
with: | |
name: module | |
path: ~/.local/share/powershell/Modules/Croze/ | |
- name: Test with Pester | |
shell: pwsh | |
run: | | |
Invoke-Pester -Configuration (New-PesterConfiguration -Hashtable @{ | |
Run = @{ | |
Exit = $true | |
} | |
Output = @{ | |
Verbosity = 'Detailed' | |
} | |
}) | |
- name: Upload Homebrew logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Homebrew-logs | |
path: "~/Library/Logs/Homebrew/" | |
Publish: | |
needs: Test | |
if: github.event_name == 'release' && github.event.action == 'published' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download module | |
uses: actions/download-artifact@v3 | |
with: | |
name: module | |
path: '~/.local/share/powershell/Modules/Croze' | |
- name: Publish Module | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
shell: pwsh | |
run: Write-Output "Publishing..."; Publish-Module -Name Croze -NuGetApiKey $env:NUGET_KEY -Exclude @('Croze.ps1') |