Action-Test - [🩹 [Patch]Run tests on all OS'es #19] by @MariusStorhaug #262
Workflow file for this run
This file contains hidden or 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
| name: Action-Test | |
| run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}" | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| ActionTest: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| name: Action-Test - [${{ matrix.os }}] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| # Need to check out as part of the test, as its a local action | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Basic | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Debug: true | |
| Verbose: true | |
| - name: WithScript | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Debug: true | |
| Verbose: true | |
| Script: | | |
| LogGroup 'Get-GitHubZen' { | |
| Get-GitHubZen | |
| } | |
| LogGroup 'Get-GitHubViewer' { | |
| Get-GitHubViewer -Fields name, login, id, databaseID | |
| } | |
| - name: Commands + Outputs - Set | |
| uses: ./ | |
| continue-on-error: true | |
| 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: Commands + Outputs - Read | |
| shell: pwsh | |
| continue-on-error: true | |
| 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' | |
| - name: WithoutToken | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Token: '' | |
| Script: | | |
| LogGroup 'My group' { | |
| 'This is a group' | |
| } | |
| - name: WithPAT | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Token: ${{ secrets.TEST_USER_PAT }} | |
| Script: | | |
| LogGroup 'Get-GitHubUser' { | |
| Get-GitHubUser | Format-Table -AutoSize | |
| } | |
| - name: WithUserFGPAT | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Token: ${{ secrets.TEST_USER_USER_FG_PAT }} | |
| Script: | | |
| LogGroup 'Get-GitHubUser' { | |
| Get-GitHubUser | Format-Table -AutoSize | |
| } | |
| - name: WithOrgFGPAT | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| Token: ${{ secrets.TEST_USER_ORG_FG_PAT }} | |
| Script: | | |
| LogGroup 'Get-GitHubUser' { | |
| Get-GitHubUser | Format-Table -AutoSize | |
| } | |
| - name: GitHubAppEnt | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| ClientID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} | |
| PrivateKey: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} | |
| 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 | |
| } | |
| } | |
| - name: GitHubAppOrg | |
| uses: ./ | |
| continue-on-error: true | |
| with: | |
| ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} | |
| PrivateKey: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} | |
| 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 | |
| } | |
| } |