⬆️ Bump actions/download-artifact from 2.0.9 to 4.1.7 in /.github/workflows #123
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: PSKoans CI | ||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main branch | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
env: | ||
NupkgArtifactName: 'PSKoans.nupkg' | ||
ModuleArtifactName: 'PSKoans' | ||
PesterInfoFileName: 'PesterVersion.txt' | ||
PesterInfoFilePath: '$GITHUB_WORKSPACE/PesterVersion.txt' | ||
jobs: | ||
create_changelog: | ||
name: 'Upload Changelog' | ||
# Don't run this step for pull requests | ||
if: ${{ github.head_ref == '' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
FilePath: '$GITHUB_WORKSPACE/Changelog.md' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Generate Changelog | ||
shell: pwsh | ||
run: ./Build/New-Changelog.ps1 -Path "${{ env.FilePath }}" -ApiKey "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Upload Changelog | ||
uses: actions/[email protected] | ||
with: | ||
name: Changelog.md | ||
path: $FilePath | ||
build: | ||
name: 'Build Module' | ||
runs-on: ubuntu-latest | ||
env: | ||
FileSystemDeploymentPath: '$GITHUB_WORKSPACE/Deploy/FileSystem' | ||
BuiltModulePath: '$GITHUB_WORKSPACE/Deploy/PSKoans' | ||
# This needs to be set by the script which creates the nupkg | ||
NupkgPath: '' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Dependencies | ||
shell: pwsh | ||
run: | | ||
$Params = @{ | ||
Scope = 'CurrentUser' | ||
Force = $true | ||
} | ||
Write-Host "Installing Modules" | ||
$Params.Name = @( 'PSDeploy', 'BuildHelpers', 'PlatyPS' ) | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
$Params.Name = 'Pester' | ||
$Params.SkipPublisherCheck = $true | ||
$Params.MinimumVersion = $Params.MinimumVersion = (Get-Module -ListAvailable ./PSKoans).RequiredModules.Where{$_.Name -eq 'Pester'}.Version | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
$Params.MinimumVersion | Set-Content -Path "${{ env.PesterInfoFilePath }}" | ||
$Params.Remove('SkipPublisherCheck') | ||
$Params.Remove('MinimumVersion') | ||
$Params.Name = 'EZOut' | ||
$Params.AllowClobber = $true | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
- name: Setup Environment | ||
shell: pwsh | ||
run: ./Build/Initialize-Environment.ps1 | ||
- name: Build Module | ||
shell: pwsh | ||
run: ./Build/Build-Module.ps1 | ||
- name: Upload Module Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: $ModuleArtifactName | ||
path: $BuiltModulePath | ||
- name: Upload Pester Version Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: $PesterInfoFileName | ||
path: $PesterInfoFilePath | ||
- name: Generate Nupkg | ||
shell: pwsh | ||
run: | | ||
./Build/Register-FileSystemRepository.ps1 -Path '${{ env.FileSystemDeploymentPath }}' -Name 'FileSystem' | ||
./Deploy/Publish.ps1 -Key 'filesystem' -Path '${{ env.FileSystemDeploymentPath }}' -OutputDirectory '${{ env.FileSystemDeploymentPath }}' | ||
- name: Upload Nupkg Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: $NupkgArtifactName | ||
path: $NupkgPath | ||
test: | ||
name: "Test Module" | ||
needs: build | ||
strategy: | ||
matrix: | ||
os: | ||
- windows-latest | ||
- macOS-latest | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
PackageDownloadPath: '$GITHUB_WORKSPACE/Module' | ||
PSRepositoryName: 'FileSystem' | ||
# The following variables MUST be set in Invoke-ModuleTests.ps1 | ||
TestFile: '' | ||
CodeCoverageFile: '' | ||
ModuleFolders: '' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install Dependencies | ||
shell: pwsh | ||
run: | | ||
$Params = @{ | ||
Scope = 'CurrentUser' | ||
Force = $true | ||
} | ||
Write-Host "Installing Modules" | ||
$Params.Name = @( 'PSDeploy', 'BuildHelpers', 'PlatyPS' ) | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
$Params.Name = 'Pester' | ||
$Params.SkipPublisherCheck = $true | ||
$Params.MinimumVersion = $Params.MinimumVersion = (Get-Module -ListAvailable ./PSKoans).RequiredModules.Where{$_.Name -eq 'Pester'}.Version | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
$Params.Remove('SkipPublisherCheck') | ||
$Params.Remove('MinimumVersion') | ||
$Params.Name = 'EZOut' | ||
$Params.AllowClobber = $true | ||
$Params | Out-String | Write-Host | ||
Install-Module @Params | ||
- name: Setup Environment | ||
shell: pwsh | ||
run: ./Build/Initialize-Environment.ps1 | ||
- name: Register FileSystem Repository | ||
shell: pwsh | ||
run: ./Build/Register-FileSystemRepository.ps1 -Path '${{ env.PackageDownloadPath }}' -Name '${{ env.PSRepositoryName }}' | ||
- name: Download Module Nupkg | ||
uses: actions/[email protected] | ||
with: | ||
name: $NupkgArtifactName | ||
path: $PackageDownloadPath | ||
- name: Download Pester Version Information | ||
uses: actions/[email protected] | ||
with: | ||
name: $PesterInfoFileName | ||
path: $PesterInfoFilePath | ||
- name: Install Module from Nupkg | ||
shell: pwsh | ||
run: | | ||
$pesterParams = @{ | ||
Name = 'Pester' | ||
MinimumVersion = Get-Content -Path "${{ env.PesterInfoFilePath }}" | ||
ProviderName = 'NuGet' | ||
Path = '${{ env.PackageDownloadPath }}' | ||
Force = $true | ||
Source = 'PSGallery' | ||
} | ||
Register-PackageSource -Name PSGallery -ProviderName NuGet -Location https://www.powershellgallery.com/api/v2 -Force | ||
Save-Package @pesterParams | Select-Object -Property Name, Version, Status, Source | ||
Install-Module PSKoans -Repository ${{ env.PSRepositoryName }} -Force -Scope CurrentUser | ||
- name: Run Pester Tests | ||
shell: pwsh | ||
run: ./Build/Invoke-ModuleTests.ps1 | ||
- name: Publish Test Results | ||
if: ${{ always() }} | ||
uses: MirageNet/[email protected] | ||
with: | ||
access-token: ${{ secrets.GITHUB_TOKEN }} | ||
path: '$GITHUB_WORKSPACE\$TestResults' | ||
- name: Generate Code Coverage | ||
uses: danielpalme/[email protected] | ||
with: | ||
reports: '$GITHUB_WORKSPACE\$CodeCoverageFile' | ||
targetdir: '$GITHUB_WORKSPACE\coveragereports' | ||
sourcedirs: $SourceFolders | ||
title: PSKoans Code Coverage | ||
- name: Publish Code Coverage artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: 'Code Coverage Reports' | ||
path: '$GITHUB_WORKSPACE\coveragereports' | ||
publish: | ||
needs: test | ||
if: ${{ success() && startsWith( 'refs/tags/', env.GITHUB_REF ) }} | ||
Check failure on line 238 in .github/workflows/github.yml GitHub Actions / PSKoans CIInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
env: | ||
BuiltModulePath: '$GITHUB_WORKSPACE/Deploy/PSKoans' | ||
GalleryDeploymentPath: '$GITHUB_WORKSPACE/Deploy/PSGallery' | ||
# This variable must be set by the script | ||
TagName: '' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Download Module Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: $ModuleArtifactName | ||
path: $BuiltModulePath | ||
- name: Deploy Module to PSGallery | ||
shell: pwsh | ||
run: ./Deploy/Publish.ps1 -ApiKey '${{ secrets.PSGALLERYAPIKEY }}' -Path '${{ env.GalleryDeploymentPath }}' | ||
- name: Set Release Tag Name | ||
shell: pwsh | ||
run: | | ||
$tagName = ("${{ env.GITHUB_REF }}" -replace '^refs/tags/').Trim() | ||
"TagName=$tagname" | Add-Content -Path '${{ env.GITHUB_ENV }}' | ||
- name: Download Artifacts | ||
uses: actions/[email protected] | ||
with: | ||
path: '$GITHUB_WORKSPACE/artifacts' | ||
- name: Update Release with Artifacts & Changelog | ||
uses: Roang-zero1/[email protected] | ||
with: | ||
created_tag: $TagName | ||
changelog_file: '$GITHUB_WORKSPACE/artifacts/Changelog.md' | ||
release_title: 'PSKoans Release $TagName' |