-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
104 additions
and
91 deletions.
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,84 @@ | ||
name: "Run Pester tests" | ||
|
||
on: | ||
push: | ||
branches: | ||
- donotexist | ||
repository_dispatch: | ||
types: | ||
- webhook | ||
|
||
jobs: | ||
job-main: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
services: | ||
shlink: | ||
image: shlinkio/shlink:stable | ||
ports: | ||
- 80:8080 | ||
env: | ||
IS_HTTPS_ENABLED: false | ||
DEFAULT_DOMAIN: psshlink.codaamok | ||
options: --name shlink | ||
steps: | ||
- name: Modify DNS | ||
run: echo "127.0.0.1 psshlink.codaamok" | sudo tee -a /etc/hosts | ||
|
||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
|
||
- name: Determine Version | ||
id: gitversion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
|
||
- name: Install codaamok.build and dependent modules, and set environment variables | ||
run: | | ||
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted | ||
Install-Module "InvokeBuild" -Force | ||
$Username, $ProjectName = $env:GITHUB_REPOSITORY -split "/" | ||
Invoke-Build -File "invoke.build.ps1" -ModuleName $ProjectName -Author $Username -Task "InstallDependencies","ImportBuildModule","SetGitHubActionEnvironmentVariables" | ||
shell: pwsh | ||
|
||
- name: Build | ||
run: | | ||
$Params = @{ | ||
ModuleName = $env:GH_PROJECTNAME | ||
Author = $env:GH_USERNAME | ||
Version = $env:GitVersion_MajorMinorPatch | ||
NewRelease = $true | ||
} | ||
Invoke-Build -File "custom.build.ps1" @Params -Task PreBuild | ||
Invoke-Build -File "invoke.build.ps1" @Params | ||
Invoke-Build -File "custom.build.ps1" @Params -Task PostBuild | ||
shell: pwsh | ||
|
||
- name: Generate Shlink API key | ||
run: | | ||
New-BuildEnvironmentVariable -Platform "GitHubActions" -Variable @{ | ||
"ShlinkAPIKey" = [Regex]::Match((docker exec -t shlink shlink api-key:generate --no-ansi), '([0-9A-Fa-f]{8}(?:-[0-9A-Fa-f]{4}){3}-[0-9A-Fa-f]{12})') | | ||
Select-Object -ExpandProperty Value | | ||
ConvertTo-SecureString -AsPlainText -Force | | ||
ConvertFrom-SecureString | ||
"ShlinkServer" = "http://psshlink.codaamok" | ||
} | ||
shell: pwsh | ||
|
||
- name: Pester Acceptance Tests Report | ||
uses: zyborg/[email protected] | ||
with: | ||
include_paths: './tests/Public/New-*.Acceptance.Tests.ps1, ./tests/Public/Get-*.Acceptance.Tests.ps1, ./tests/Public/Save-*.Acceptance.Tests.ps1, ./tests/Public/Set-ShlinkUrl.Acceptance.Tests.ps1, ./tests/Public/Set-ShlinkTag.Acceptance.Tests.ps1, ./tests/Public/Remove-*.Acceptance.Tests.ps1' | ||
report_name: Pester Acceptance Tests Report | ||
report_title: Pester Acceptance Tests Report | ||
output_level: detailed | ||
tests_fail_step: true | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
name: "Test workflow dispatch" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
job-main: | ||
name: Test workflow dispatch | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Repository Dispatch | ||
uses: peter-evans/[email protected] | ||
with: | ||
token: ${{ secrets.GH_PAT }} | ||
repository: codaamok/PSShlink | ||
event-type: webhook |