88name : Build
99on :
1010 push :
11- branches : [ main, 'release/*' ]
11+ branches : [main, 'release/*']
1212 pull_request :
13- branches : [ main, 'release/*' ]
13+ branches : [main, 'release/*']
1414 schedule :
1515 - cron : ' 26 21 * * 0' # At 09:26 PM, on Sunday each week
1616 workflow_dispatch : {}
@@ -29,50 +29,52 @@ jobs:
2929 contents : read
3030
3131 steps :
32+ - name : Checkout
33+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
34+
35+ - name : Setup .NET
36+ uses : actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
37+ with :
38+ global-json-file : global.json
39+
40+ - name : Install dependencies
41+ shell : pwsh
42+ timeout-minutes : 3
43+ run : |
44+ ./scripts/pipeline-deps.ps1;
45+ Import-Module ./scripts/dependencies.psm1 -Force;
46+ Install-Dependencies -Dev -Repository 'PSGallery' -TrustRepository;
47+
48+ - name : Build module
49+ shell : pwsh
50+ timeout-minutes : 5
51+ run : Invoke-Build -Configuration Release -AssertStyle GitHubActions
52+
53+ - name : Upload module
54+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
55+ with :
56+ name : Module
57+ path : ./out/modules/PSRule.Rules.Azure/*
58+ retention-days : 3
59+ if-no-files-found : error
3260
33- - name : Checkout
34- uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
35-
36- - name : Setup .NET
37- uses : actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
38- with :
39- global-json-file : global.json
40-
41- - name : Install dependencies
42- shell : pwsh
43- timeout-minutes : 3
44- run : ./scripts/pipeline-deps.ps1
45-
46- - name : Build module
47- shell : pwsh
48- timeout-minutes : 5
49- run : Invoke-Build -Configuration Release -AssertStyle GitHubActions
50-
51- - name : Upload module
52- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
53- with :
54- name : Module
55- path : ./out/modules/PSRule.Rules.Azure/*
56- retention-days : 3
57- if-no-files-found : error
58-
59- # - name: Upload Test Results
60- # uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
61- # if: always()
62- # with:
63- # name: Module.DotNet.TestResults
64- # path: ./reports/*.trx
65- # retention-days: 3
66- # if-no-files-found: error
67-
68- - name : Upload PSRule Results
69- uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
70- if : always()
71- with :
72- name : Results-PSRule
73- path : ./reports/ps-rule*.xml
74- retention-days : 3
75- if-no-files-found : error
61+ # - name: Upload Test Results
62+ # uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
63+ # if: always()
64+ # with:
65+ # name: Module.DotNet.TestResults
66+ # path: ./reports/*.trx
67+ # retention-days: 3
68+ # if-no-files-found: error
69+
70+ - name : Upload PSRule Results
71+ uses : actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
72+ if : always()
73+ with :
74+ name : Results-PSRule
75+ path : ./reports/ps-rule*.xml
76+ retention-days : 3
77+ if-no-files-found : error
7678
7779 test_module :
7880 name : 🧪 Test module (${{ matrix.rid }}-${{ matrix.shell }})
8688 fail-fast : false
8789
8890 matrix :
89- os : [ 'ubuntu-latest' ]
90- rid : [ 'linux-x64' ]
91- shell : [ 'pwsh' ]
91+ os : ['ubuntu-latest']
92+ rid : ['linux-x64']
93+ shell : ['pwsh']
9294 include :
9395 - os : windows-latest
9496 rid : win-x64
@@ -107,44 +109,49 @@ jobs:
107109 shell : pwsh
108110
109111 steps :
112+ - name : Checkout
113+ uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
110114
111- - name : Checkout
112- uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
113-
114- - name : Setup .NET
115- uses : actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
116- with :
117- global-json-file : global.json
118-
119- - if : ${{ matrix.shell == 'pwsh' }}
120- name : Install dependencies (PowerShell)
121- shell : pwsh
122- timeout-minutes : 3
123- run : ./scripts/pipeline-deps.ps1
124-
125- - if : ${{ matrix.shell == 'powershell' }}
126- name : Install dependencies (Windows PowerShell)
127- shell : powershell
128- timeout-minutes : 3
129- run : ./scripts/pipeline-deps.ps1
130-
131- - name : Download module
132- uses : actions/download-artifact@v8
133- with :
134- name : Module
135- path : ./out/modules/PSRule.Rules.Azure
136-
137- - if : ${{ matrix.shell == 'pwsh' }}
138- name : Test module (PowerShell)
139- shell : pwsh
140- timeout-minutes : 15
141- run : Invoke-Build TestModule -Configuration Release -AssertStyle GitHubActions
142-
143- - if : ${{ matrix.shell == 'powershell' }}
144- name : Test module (Windows PowerShell)
145- shell : powershell
146- timeout-minutes : 30
147- run : Invoke-Build TestModule -Configuration Release -AssertStyle GitHubActions
115+ - name : Setup .NET
116+ uses : actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
117+ with :
118+ global-json-file : global.json
119+
120+ - if : ${{ matrix.shell == 'pwsh' }}
121+ name : Install dependencies (PowerShell)
122+ shell : pwsh
123+ timeout-minutes : 3
124+ run : |
125+ ./scripts/pipeline-deps.ps1;
126+ Import-Module ./scripts/dependencies.psm1 -Force;
127+ Install-Dependencies -Dev -Repository 'PSGallery' -TrustRepository;
128+
129+ - if : ${{ matrix.shell == 'powershell' }}
130+ name : Install dependencies (Windows PowerShell)
131+ shell : powershell
132+ timeout-minutes : 5
133+ run : |
134+ ./scripts/pipeline-deps.ps1;
135+ Import-Module ./scripts/dependencies.psm1 -Force;
136+ Install-Dependencies -Dev -Repository 'PSGallery' -TrustRepository;
137+
138+ - name : Download module
139+ uses : actions/download-artifact@v8
140+ with :
141+ name : Module
142+ path : ./out/modules/PSRule.Rules.Azure
143+
144+ - if : ${{ matrix.shell == 'pwsh' }}
145+ name : Test module (PowerShell)
146+ shell : pwsh
147+ timeout-minutes : 15
148+ run : Invoke-Build TestModule -Configuration Release -AssertStyle GitHubActions
149+
150+ - if : ${{ matrix.shell == 'powershell' }}
151+ name : Test module (Windows PowerShell)
152+ shell : powershell
153+ timeout-minutes : 30
154+ run : Invoke-Build TestModule -Configuration Release -AssertStyle GitHubActions
148155
149156 build_docs :
150157 name : Build docs
@@ -172,7 +179,10 @@ jobs:
172179 - name : Install dependencies (PowerShell)
173180 shell : pwsh
174181 timeout-minutes : 3
175- run : ./scripts/pipeline-deps.ps1
182+ run : |
183+ ./scripts/pipeline-deps.ps1;
184+ Import-Module ./scripts/dependencies.psm1 -Force;
185+ Install-Dependencies -Dev -Repository 'PSGallery' -TrustRepository;
176186
177187 - name : Build docs
178188 shell : pwsh
0 commit comments