chore: refactor ci workflow

Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
This commit is contained in:
Chawye Hsu 2026-04-01 16:17:08 +08:00
parent 7c29003e68
commit fc6ac316d3
No known key found for this signature in database
GPG Key ID: 5AE5178B3E1624DA
5 changed files with 22 additions and 32 deletions

View File

@ -1,4 +1,4 @@
name: Tests
name: CI
on:
pull_request:
@ -6,43 +6,33 @@ on:
workflow_dispatch:
jobs:
test_powershell:
name: WindowsPowerShell
test:
name: Test
runs-on: windows-latest
strategy:
matrix:
shell: [powershell, pwsh]
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout Bucket
uses: actions/checkout@main
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
# Need at least 2 commits to properly gather changed files for linting
fetch-depth: 2
path: 'my_bucket'
- name: Checkout Scoop
uses: actions/checkout@main
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: ScoopInstaller/Scoop
path: 'scoop_core'
- name: Init and Test
shell: powershell
- name: Install and cache test dependencies
uses: potatoqualitee/psmodulecache@ee5e9494714abf56f6efbfa51527b2aec5c761b8 # v6.2.1
with:
modules-to-cache: BuildHelpers, Pester
shell: ${{ matrix.shell }}
- name: Run tests
run: |
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
.\scoop_core\test\bin\init.ps1
.\my_bucket\bin\test.ps1
test_pwsh:
name: PowerShell
runs-on: windows-latest
steps:
- name: Checkout Bucket
uses: actions/checkout@main
with:
fetch-depth: 2
path: 'my_bucket'
- name: Checkout Scoop
uses: actions/checkout@main
with:
repository: ScoopInstaller/Scoop
path: 'scoop_core'
- name: Init and Test
shell: pwsh
run: |
$env:SCOOP_HOME="$(Resolve-Path '.\scoop_core')"
.\scoop_core\test\bin\init.ps1
.\my_bucket\bin\test.ps1

View File

@ -8,7 +8,7 @@ jobs:
name: Excavate
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Excavate
uses: ScoopInstaller/GithubActions@main
env:

View File

@ -7,7 +7,7 @@ jobs:
name: PullRequestHandler
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: PullRequestHandler
uses: ScoopInstaller/GithubActions@main
if: startsWith(github.event.comment.body, '/verify')

View File

@ -7,7 +7,7 @@ jobs:
name: IssueHandler
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: IssueHandler
uses: ScoopInstaller/GithubActions@main
if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify'))

View File

@ -7,7 +7,7 @@ jobs:
name: PullRequestHandler
runs-on: windows-latest
steps:
- uses: actions/checkout@main
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: PullRequestHandler
uses: ScoopInstaller/GithubActions@main
env: