-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): add test, lint and release jobs (#1)
* feat(ci): add test & lint jobs * fix(ci): release asset test to account for slight differences in paths fix typo in module name * feat(ci): include modules in lint path filter * feat(ci): add release-please job
- Loading branch information
1 parent
a9c2589
commit 474d495
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: CI | ||
on: | ||
push: | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: | | ||
Invoke-Pester -PassThru | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- shell: pwsh | ||
run: | | ||
Set-PSRepository PSGallery -InstallationPolicy Trusted | ||
Install-Module PSScriptAnalyzer | ||
- shell: pwsh | ||
run: | | ||
Invoke-ScriptAnalyzer -Path *.ps* -Recurse -Outvariable issues | ||
$errors = $issues.Where({$_.Severity -eq 'Error'}) | ||
$warnings = $issues.Where({$_.Severity -eq 'Warning'}) | ||
if ($errors) { | ||
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop | ||
} else { | ||
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." | ||
} | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: [test, lint] | ||
if: github.ref == 'refs/heads/main' | ||
steps: | ||
- uses: google-github-actions/release-please-action@v4 | ||
with: | ||
token: ${{ secrets.REPO_TOKEN }} | ||
release-type: simple |
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