Downgrade chocolatey to allow for v1 coverage (#13) #79
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: [ master ] | |
pull_request: | |
branches: [ master ] | |
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-preview-cache | |
- name: Install Crescendo | |
if: steps.cacher.outputs.cache-hit != 'true' | |
shell: pwsh | |
run: Install-Module Microsoft.PowerShell.Crescendo -AllowPrerelease -RequiredVersion 1.1.0-Preview01 -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: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Download module | |
uses: actions/download-artifact@v3 | |
with: | |
name: module | |
path: C:\Users\runneradmin\Documents\PowerShell\Modules\Foil\ | |
- name: Test with Pester | |
run: | | |
Invoke-Pester -Configuration (New-PesterConfiguration -Hashtable @{ | |
Run = @{ | |
Exit = $true | |
} | |
Output = @{ | |
Verbosity = 'Detailed' | |
} | |
}) | |
- name: Upload Chocolatey logs | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: choco-logs | |
path: C:\ProgramData\chocolatey\logs\ | |
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/Foil' | |
- name: Publish Module | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_KEY }} | |
shell: pwsh | |
run: Write-Output "Publishing..."; Publish-Module -Name Foil -NuGetApiKey $env:NUGET_KEY -Exclude @('foil.ps1') |