Skip to content

🩹 [Patch]: Run tests on all OS'es #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 7 additions & 163 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,168 +17,12 @@ permissions:
pull-requests: read

jobs:
ActionTestBasic:
name: Action-Test - [Basic]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Debug: true
Verbose: true

ActionTestWithScript:
name: Action-Test - [WithScript]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Debug: true
Verbose: true
Script: |
LogGroup 'Get-GitHubZen' {
Get-GitHubZen
}

LogGroup 'Get-GitHubViewer' {
Get-GitHubViewer -Fields name, login, id, databaseID
}

ActionTestCommands:
name: Action-Test - [Commands]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
id: test
with:
Debug: true
Verbose: true
Prerelease: true
ShowOutput: true
Script: |
$cat = Get-GitHubOctocat
$zen = Get-GitHubZen
Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
Set-GitHubOutput -Name 'WISECAT' -Value $cat
Set-GitHubOutput -Name 'Zen' -Value $zen

- name: Run-test
shell: pwsh
env:
result: ${{ steps.test.outputs.result }}
WISECAT: ${{ fromJson(steps.test.outputs.result).WISECAT }}
run: |
$result = $env:result | ConvertFrom-Json
Set-GitHubStepSummary -Summary $env:WISECAT
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'

ActionTestWithoutToken:
name: Action-Test - [WithoutToken]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Token: ''
Script: |
LogGroup 'My group' {
'This is a group'
}

ActionTestWithPAT:
name: Action-Test - [WithPAT]
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Token: ${{ secrets.TEST_USER_PAT }}
Script: |
LogGroup 'Get-GitHubUser' {
Get-GitHubUser | Format-Table -AutoSize
}

ActionTestWithFGPAT:
ActionTest:
uses: ./.github/workflows/TestWorkflow.yml
secrets: inherit
strategy:
fail-fast: false
matrix:
include:
- name: Action-Test - [WithUserFGPAT]
Token: TEST_USER_USER_FG_PAT
- name: Action-Test - [WithOrgFGPAT]
Token: TEST_USER_ORG_FG_PAT
name: ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
Token: ${{ secrets[matrix.Token] }}
Script: |
LogGroup 'Get-GitHubUser' {
Get-GitHubUser | Format-Table -AutoSize
}

ActionTestWithGitHubApp:
strategy:
matrix:
include:
- name: Action-Test - [GitHubAppEnt]
clientID: TEST_APP_ENT_CLIENT_ID
privateKey: TEST_APP_ENT_PRIVATE_KEY
- name: Action-Test - [GitHubAppOrg]
clientID: TEST_APP_ORG_CLIENT_ID
privateKey: TEST_APP_ORG_PRIVATE_KEY
name: ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
# Need to check out as part of the test, as its a local action
- name: Checkout repo
uses: actions/checkout@v4

- name: Action-Test
uses: ./
with:
ClientID: ${{ secrets[matrix.clientID] }}
PrivateKey: ${{ secrets[matrix.privateKey] }}
Script: |
LogGroup 'Get-GitHubApp' {
Get-GitHubApp | Format-Table -AutoSize
}

LogGroup 'Get-GitHubAppInstallation' {
Get-GitHubAppInstallation | Format-Table -AutoSize
}

LogGroup 'Do something as an installation' {
Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
Connect-GitHub -Token $_.token -Silent
Get-GitHubContext | Format-Table -AutoSize
Get-GitHubGitConfig | Format-Table -AutoSize
}
}
os: [ubuntu-latest, macos-latest, windows-latest]
with:
runs-on: ${{ matrix.os }}
1 change: 1 addition & 0 deletions .github/workflows/Linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
VALIDATE_MARKDOWN_PRETTIER: false
VALIDATE_YAML_PRETTIER: false
VALIDATE_JSCPD: false
Loading