Skip to content

Commit f474638

Browse files
huiyifyjPengxn
andauthored
ci: add actions workflow to test install (#6)
* ci: add actions workflow to test install - Use `MinoruSekine/setup-scoop` action to setup scoop. - Run `Install-Test.ps1` script to validate manifest changes and test installation. * ci: set git fetch-depth to `2` for proper diff comparison Set fetch-depth to `2` in `actions/checkout` action configuration, to ensure sufficient git history for file change detection. The `fetch-depth` option default value is `1`, refer to https://github.com/actions/checkout/blob/v4.2.2/action.yml#L76 * ci: run `Check-Version.ps1` before testing and add missing setting - Add the last commit missing `fetch-depth: 2` setting for `Test PowerShell Core` job. - Execute `Check-Version.ps1` script before running `Install-Test.ps1`. - Rename step name: 'Install-Test' => 'Check Version and Test'. --------- Co-authored-by: Feng.YJ <[email protected]> Co-authored-by: Peng.xn <[email protected]>
1 parent e7b9eb2 commit f474638

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: test
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test-powershell:
7+
name: Test WindowsPowerShell
8+
runs-on: windows-latest
9+
steps:
10+
- name: Setup Scoop
11+
uses: MinoruSekine/setup-scoop@v4
12+
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 2
17+
18+
- name: Install xn bucket
19+
shell: powershell
20+
run: scoop bucket add xn https://github.com/Pengxn/xn
21+
22+
- name: Check Version and Test
23+
shell: powershell
24+
run: |
25+
.\bin\Check-Version.ps1
26+
.\test\Install-Test.ps1
27+
28+
test-pwsh:
29+
name: Test PowerShell Core
30+
runs-on: windows-latest
31+
steps:
32+
- name: Setup Scoop
33+
uses: MinoruSekine/setup-scoop@v4
34+
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 2
39+
40+
- name: Install xn bucket
41+
shell: powershell
42+
run: scoop bucket add xn https://github.com/Pengxn/xn
43+
44+
- name: Check Version and Test
45+
shell: pwsh
46+
run: |
47+
.\bin\Check-Version.ps1
48+
.\test\Install-Test.ps1

0 commit comments

Comments
 (0)