@@ -17,29 +17,25 @@ permissions:
1717 pull-requests : read
1818
1919jobs :
20- ActionTestBasic :
21- name : Action-Test - [Basic]
22- runs-on : ubuntu-latest
20+ ActionTest :
21+ strategy :
22+ fail-fast : false
23+ matrix :
24+ os : [ubuntu-latest, macos-latest, windows-latest]
25+ name : Action-Test - [${{ matrix.os }}]
26+ runs-on : ${{ matrix.os }}
2327 steps :
2428 # Need to check out as part of the test, as its a local action
2529 - name : Checkout repo
2630 uses : actions/checkout@v4
2731
28- - name : Action-Test
32+ - name : Basic
2933 uses : ./
3034 with :
3135 Debug : true
3236 Verbose : true
3337
34- ActionTestWithScript :
35- name : Action-Test - [WithScript]
36- runs-on : ubuntu-latest
37- steps :
38- # Need to check out as part of the test, as its a local action
39- - name : Checkout repo
40- uses : actions/checkout@v4
41-
42- - name : Action-Test
38+ - name : WithScript
4339 uses : ./
4440 with :
4541 Debug : true
5349 Get-GitHubViewer -Fields name, login, id, databaseID
5450 }
5551
56- ActionTestCommands :
57- name : Action-Test - [Commands]
58- runs-on : ubuntu-latest
59- steps :
60- # Need to check out as part of the test, as its a local action
61- - name : Checkout repo
62- uses : actions/checkout@v4
63-
64- - name : Action-Test
52+ - name : Commands + Outputs - Set
6553 uses : ./
6654 id : test
6755 with :
7664 Set-GitHubOutput -Name 'WISECAT' -Value $cat
7765 Set-GitHubOutput -Name 'Zen' -Value $zen
7866
79- - name : Run-test
67+ - name : Commands + Outputs - Read
8068 shell : pwsh
8169 env :
8270 result : ${{ steps.test.outputs.result }}
8674 Set-GitHubStepSummary -Summary $env:WISECAT
8775 Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
8876
89- ActionTestWithoutToken :
90- name : Action-Test - [WithoutToken]
91- runs-on : ubuntu-latest
92- steps :
93- # Need to check out as part of the test, as its a local action
94- - name : Checkout repo
95- uses : actions/checkout@v4
96-
97- - name : Action-Test
77+ - name : WithoutToken
9878 uses : ./
9979 with :
10080 Token : ' '
@@ -103,15 +83,7 @@ jobs:
10383 'This is a group'
10484 }
10585
106- ActionTestWithPAT :
107- name : Action-Test - [WithPAT]
108- runs-on : ubuntu-latest
109- steps :
110- # Need to check out as part of the test, as its a local action
111- - name : Checkout repo
112- uses : actions/checkout@v4
113-
114- - name : Action-Test
86+ - name : WithPAT
11587 uses : ./
11688 with :
11789 Token : ${{ secrets.TEST_USER_PAT }}
@@ -120,52 +92,51 @@ jobs:
12092 Get-GitHubUser | Format-Table -AutoSize
12193 }
12294
123- ActionTestWithFGPAT :
124- strategy :
125- matrix :
126- include :
127- - name : Action-Test - [WithUserFGPAT]
128- Token : TEST_USER_USER_FG_PAT
129- - name : Action-Test - [WithOrgFGPAT]
130- Token : TEST_USER_ORG_FG_PAT
131- name : ${{ matrix.name }}
132- runs-on : ubuntu-latest
133- steps :
134- # Need to check out as part of the test, as its a local action
135- - name : Checkout repo
136- uses : actions/checkout@v4
95+ - name : WithUserFGPAT
96+ uses : ./
97+ with :
98+ Token : ${{ secrets.TEST_USER_USER_FG_PAT }}
99+ Script : |
100+ LogGroup 'Get-GitHubUser' {
101+ Get-GitHubUser | Format-Table -AutoSize
102+ }
137103
138- - name : Action-Test
104+ - name : WithOrgFGPAT
139105 uses : ./
140106 with :
141- Token : ${{ secrets[matrix.Token] }}
107+ Token : ${{ secrets.TEST_USER_ORG_FG_PAT }}
142108 Script : |
143109 LogGroup 'Get-GitHubUser' {
144110 Get-GitHubUser | Format-Table -AutoSize
145111 }
146112
147- ActionTestWithGitHubApp :
148- strategy :
149- matrix :
150- include :
151- - name : Action-Test - [GitHubAppEnt]
152- clientID : TEST_APP_ENT_CLIENT_ID
153- privateKey : TEST_APP_ENT_PRIVATE_KEY
154- - name : Action-Test - [GitHubAppOrg]
155- clientID : TEST_APP_ORG_CLIENT_ID
156- privateKey : TEST_APP_ORG_PRIVATE_KEY
157- name : ${{ matrix.name }}
158- runs-on : ubuntu-latest
159- steps :
160- # Need to check out as part of the test, as its a local action
161- - name : Checkout repo
162- uses : actions/checkout@v4
113+ - name : GitHubAppEnt
114+ uses : ./
115+ with :
116+ ClientID : ${{ secrets.TEST_APP_ENT_CLIENT_ID }}
117+ PrivateKey : ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }}
118+ Script : |
119+ LogGroup 'Get-GitHubApp' {
120+ Get-GitHubApp | Format-Table -AutoSize
121+ }
122+
123+ LogGroup 'Get-GitHubAppInstallation' {
124+ Get-GitHubAppInstallation | Format-Table -AutoSize
125+ }
126+
127+ LogGroup 'Do something as an installation' {
128+ Get-GithubAppInstallation | New-GitHubAppInstallationAccessToken | ForEach-Object {
129+ Connect-GitHub -Token $_.token -Silent
130+ Get-GitHubContext | Format-Table -AutoSize
131+ Get-GitHubGitConfig | Format-Table -AutoSize
132+ }
133+ }
163134
164- - name : Action-Test
135+ - name : GitHubAppOrg
165136 uses : ./
166137 with :
167- ClientID : ${{ secrets[matrix.clientID] }}
168- PrivateKey : ${{ secrets[matrix.privateKey] }}
138+ ClientID : ${{ secrets.TEST_APP_ORG_CLIENT_ID }}
139+ PrivateKey : ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }}
169140 Script : |
170141 LogGroup 'Get-GitHubApp' {
171142 Get-GitHubApp | Format-Table -AutoSize
0 commit comments