Skip to content

Merge pull request #6 from ethanbergstrom/Disambiguation #52

Merge pull request #6 from ethanbergstrom/Disambiguation

Merge pull request #6 from ethanbergstrom/Disambiguation #52

Workflow file for this run

# 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-0.4.1-cache
- name: Install Crescendo
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: Install-Module Microsoft.PowerShell.Crescendo -RequiredVersion 0.4.1 -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')