Skip to content

Commit

Permalink
Merge pull request #1264 from mdaneri/#1263
Browse files Browse the repository at this point in the history
GitHub workflows
  • Loading branch information
Badgerati authored Mar 29, 2024
2 parents dd9d544 + dc1bad8 commit b5cd6ea
Show file tree
Hide file tree
Showing 7 changed files with 268 additions and 7 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/PSScriptAnalyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# https://github.com/microsoft/action-psscriptanalyzer
# For more information on PSScriptAnalyzer in general, see
# https://github.com/PowerShell/PSScriptAnalyzer

name: PSScriptAnalyzer

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
schedule:
- cron: '20 16 * * 6'

permissions:
contents: read

jobs:
build:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
name: PSScriptAnalyzer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run PSScriptAnalyzer
uses: microsoft/psscriptanalyzer-action@6b2948b1944407914a58661c49941824d149734f
with:
# Check https://github.com/microsoft/action-psscriptanalyzer for more info about the options.
# The below set up runs PSScriptAnalyzer to your entire repository and runs some basic security rules.
path: .\
recurse: true
# Include your own basic security rules. Removing this option will run all the rules
includeRule: '"PSAvoidGlobalAliases", "PSAvoidUsingConvertToSecureStringWithPlainText"'
output: results.sarif

# Upload the SARIF file generated in the previous step
- name: Upload SARIF results file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
9 changes: 7 additions & 2 deletions .github/workflows/ci-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Check PowerShell version
shell: pwsh
run: |
$PSVersionTable.PSVersion
- name: Install Invoke-Build
shell: pwsh
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -Name InvokeBuild -RequiredVersion '5.5.1' -Force
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
- name: Run Pester Tests
shell: pwsh
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/ci-powershell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Pode CI - Powershell Desktop

on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'

jobs:
build:

runs-on: windows-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Check PowerShell version
shell: powershell
run: |
$PSVersionTable.PSVersion
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install Invoke-Build
shell: powershell
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
- name: Run Pester Tests
shell: powershell
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-Build Test
53 changes: 53 additions & 0 deletions .github/workflows/ci-pwsh7_3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pode CI - pwsh 7.3 on windows-latest

on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'

jobs:
build:

runs-on: windows-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install Invoke-Build
shell: pwsh
run: |
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
# For Windows
- name: Download and extract PowerShell 7.3
run: |
Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v7.3.11/PowerShell-7.3.11-win-x64.zip" -OutFile "PowerShell-7.3.x-win-x64.zip"
Expand-Archive -LiteralPath "PowerShell-7.3.x-win-x64.zip" -DestinationPath "C:\PowerShell-7.3"
- name: Check PowerShell version
run: |
C:\PowerShell-7.3\pwsh.exe -version
- name: Run Pester Tests
run: |
C:\PowerShell-7.3\pwsh.exe -Command {
Invoke-Build Test
}
- name: Test docker builds
run: |
C:\PowerShell-7.3\pwsh.exe -Command {
Invoke-Build DockerPack -Version '0.0.0'
}
53 changes: 53 additions & 0 deletions .github/workflows/ci-pwsh7_4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pode CI - pwsh 7.4 on windows-latest

on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'

jobs:
build:

runs-on: windows-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install Invoke-Build
shell: pwsh
run: |
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
# For Windows
- name: Download and extract PowerShell 7.4
run: |
Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.zip" -OutFile "PowerShell-7.4.x-win-x64.zip"
Expand-Archive -LiteralPath "PowerShell-7.4.x-win-x64.zip" -DestinationPath "C:\PowerShell-7.4"
- name: Check PowerShell version
run: |
C:\PowerShell-7.4\pwsh.exe -version
- name: Run Pester Tests
run: |
C:\PowerShell-7.4\pwsh.exe -Command {
Invoke-Build Test
}
- name: Test docker builds
run: |
C:\PowerShell-7.4\pwsh.exe -Command {
Invoke-Build DockerPack -Version '0.0.0'
}
53 changes: 53 additions & 0 deletions .github/workflows/ci-pwsh7_5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Pode CI - pwsh 7.5 on windows-latest

on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'

jobs:
build:

runs-on: windows-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Install Invoke-Build
shell: pwsh
run: |
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
# For Windows
- name: Download and extract PowerShell 7.5
run: |
Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v7.5.0-preview.2/PowerShell-7.5.0-preview.2-win-x64.zip" -OutFile "PowerShell-7.5.x-win-x64.zip"
Expand-Archive -LiteralPath "PowerShell-7.5.x-win-x64.zip" -DestinationPath "C:\PowerShell-7.5"
- name: Check PowerShell version
run: |
C:\PowerShell-7.5\pwsh.exe -version
- name: Run Pester Tests
run: |
C:\PowerShell-7.5\pwsh.exe -Command {
Invoke-Build Test
}
- name: Test docker builds
run: |
C:\PowerShell-7.5\pwsh.exe -Command {
Invoke-Build DockerPack -Version '0.0.0'
}
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Pode CI
name: Pode CI - pwsh

on:
push:
Expand All @@ -20,18 +20,23 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Check PowerShell version
shell: pwsh
run: |
$PSVersionTable.PSVersion
- name: Setup .NET
uses: actions/setup-dotnet@v1.9.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Install Invoke-Build
shell: pwsh
run: |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Install-Module -Name InvokeBuild -RequiredVersion '5.5.1' -Force
Install-Module -Name InvokeBuild -RequiredVersion '5.10.5' -Force
- name: Run Pester Tests
shell: pwsh
Expand Down

0 comments on commit b5cd6ea

Please sign in to comment.