Add missing blank in 'can Add-Content to a file' #122
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: 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/upload-artifact@v2.2.3 | ||
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/upload-artifact@v2.2.3 | ||
with: | ||
name: $ModuleArtifactName | ||
path: $BuiltModulePath | ||
- name: Upload Pester Version Artifact | ||
uses: actions/upload-artifact@v2.2.3 | ||
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/upload-artifact@v2.2.3 | ||
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/download-artifact@v2.0.9 | ||
with: | ||
name: $NupkgArtifactName | ||
path: $PackageDownloadPath | ||
- name: Download Pester Version Information | ||
uses: actions/download-artifact@v2.0.9 | ||
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/nunit-reporter@v1.0.5 | ||
with: | ||
access-token: ${{ secrets.GITHUB_TOKEN }} | ||
path: '$GITHUB_WORKSPACE\$TestResults' | ||
- name: Generate Code Coverage | ||
uses: danielpalme/ReportGenerator-GitHub-Action@4.8.8 | ||
with: | ||
reports: '$GITHUB_WORKSPACE\$CodeCoverageFile' | ||
targetdir: '$GITHUB_WORKSPACE\coveragereports' | ||
sourcedirs: $SourceFolders | ||
title: PSKoans Code Coverage | ||
- name: Publish Code Coverage artifacts | ||
uses: actions/upload-artifact@v2.2.3 | ||
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/download-artifact@v2.0.9 | ||
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/download-artifact@v2.0.9 | ||
with: | ||
path: '$GITHUB_WORKSPACE/artifacts' | ||
- name: Update Release with Artifacts & Changelog | ||
uses: Roang-zero1/github-create-release-action@v2.1.0 | ||
with: | ||
created_tag: $TagName | ||
changelog_file: '$GITHUB_WORKSPACE/artifacts/Changelog.md' | ||
release_title: 'PSKoans Release $TagName' |