Skip to content

Commit fc6ac31

Browse files
committed
chore: refactor ci workflow
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
1 parent 7c29003 commit fc6ac31

File tree

5 files changed

+21
-31
lines changed

5 files changed

+21
-31
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,38 @@
1-
name: Tests
1+
name: CI
22

33
on:
44
pull_request:
55
push:
66
workflow_dispatch:
77

88
jobs:
9-
test_powershell:
10-
name: WindowsPowerShell
9+
test:
10+
name: Test
1111
runs-on: windows-latest
12+
strategy:
13+
matrix:
14+
shell: [powershell, pwsh]
15+
defaults:
16+
run:
17+
shell: ${{ matrix.shell }}
1218
steps:
1319
- name: Checkout Bucket
14-
uses: actions/checkout@main
20+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1521
with:
22+
# Need at least 2 commits to properly gather changed files for linting
1623
fetch-depth: 2
1724
path: 'my_bucket'
1825
- name: Checkout Scoop
19-
uses: actions/checkout@main
26+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2027
with:
2128
repository: ScoopInstaller/Scoop
2229
path: 'scoop_core'
23-
- name: Init and Test
24-
shell: powershell
25-
run: |
26-
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
27-
.\scoop_core\test\bin\init.ps1
28-
.\my_bucket\bin\test.ps1
29-
test_pwsh:
30-
name: PowerShell
31-
runs-on: windows-latest
32-
steps:
33-
- name: Checkout Bucket
34-
uses: actions/checkout@main
30+
- name: Install and cache test dependencies
31+
uses: potatoqualitee/psmodulecache@ee5e9494714abf56f6efbfa51527b2aec5c761b8 # v6.2.1
3532
with:
36-
fetch-depth: 2
37-
path: 'my_bucket'
38-
- name: Checkout Scoop
39-
uses: actions/checkout@main
40-
with:
41-
repository: ScoopInstaller/Scoop
42-
path: 'scoop_core'
43-
- name: Init and Test
44-
shell: pwsh
33+
modules-to-cache: BuildHelpers, Pester
34+
shell: ${{ matrix.shell }}
35+
- name: Run tests
4536
run: |
4637
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
47-
.\scoop_core\test\bin\init.ps1
4838
.\my_bucket\bin\test.ps1

.github/workflows/excavator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
name: Excavate
99
runs-on: windows-latest
1010
steps:
11-
- uses: actions/checkout@main
11+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1212
- name: Excavate
1313
uses: ScoopInstaller/GithubActions@main
1414
env:

.github/workflows/issue_comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: PullRequestHandler
88
runs-on: windows-latest
99
steps:
10-
- uses: actions/checkout@main
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1111
- name: PullRequestHandler
1212
uses: ScoopInstaller/GithubActions@main
1313
if: startsWith(github.event.comment.body, '/verify')

.github/workflows/issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: IssueHandler
88
runs-on: windows-latest
99
steps:
10-
- uses: actions/checkout@main
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1111
- name: IssueHandler
1212
uses: ScoopInstaller/GithubActions@main
1313
if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))

.github/workflows/pull_request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
name: PullRequestHandler
88
runs-on: windows-latest
99
steps:
10-
- uses: actions/checkout@main
10+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1111
- name: PullRequestHandler
1212
uses: ScoopInstaller/GithubActions@main
1313
env:

0 commit comments

Comments
 (0)