Skip to content

Commit 20ebd85

Browse files
committed
Add workflow for Nushell install and upgrade tests by winget
1 parent cc5560a commit 20ebd85

File tree

4 files changed

+176
-24
lines changed

4 files changed

+176
-24
lines changed

.github/workflows/test-upgrade.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Description: This workflow runs tests for hustcer/deepseek-review.
2+
# REF:
3+
# - https://github.com/vyadh/nutest/blob/main/.github/workflows/tests.yaml
4+
# - https://github.com/fdncred/winget-pkgs/blob/master/doc/manifest/schema/1.10.0/installer.md
5+
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
6+
7+
name: Run Nushell Upgrade Tests
8+
9+
on:
10+
pull_request:
11+
paths-ignore:
12+
- '**.md'
13+
- 'docs/**'
14+
workflow_dispatch:
15+
push:
16+
branches:
17+
- main
18+
- develop
19+
- feature/msi-test
20+
paths-ignore:
21+
- '**.md'
22+
- 'docs/**'
23+
schedule:
24+
- cron: '0 2 * * *' # Run every morning at 2am UTC
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
default:
31+
name: Install and Upgrade Nushell
32+
33+
strategy:
34+
fail-fast: false
35+
matrix:
36+
os: [windows-latest, windows-2025]
37+
38+
runs-on: ${{ matrix.os }}
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install winget
44+
if: ${{ matrix.os == 'windows-latest' }}
45+
uses: Cyberboss/install-winget@v1
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- name: Setup Winget
50+
run: |
51+
winget --version
52+
winget settings --enable LocalManifestFiles
53+
winget settings --enable InstallerHashOverride
54+
55+
- name: Setup Nu
56+
uses: hustcer/setup-nu@v3
57+
with:
58+
version: 'nightly'
59+
60+
- name: Test Nushell Upgrade
61+
shell: nu {0}
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
run: |
65+
use ${{ github.workspace }}/tests/test-all.nu *
66+
test-winget-per-user-install
67+
test-winget-per-user-upgrade
68+
test-winget-per-machine-install
69+
test-winget-per-machine-upgrade
70+
71+

manifests/n/Nushell/Nushell/0.105.0/Nushell.Nushell.installer.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,41 @@ Installers:
2020
Scope: user
2121
InstallerSwitches:
2222
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
23-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
24-
InstallerSha256: 0580682DC237E7919347666274BE65377E62115863100341DEC92FEF8E018B2E
23+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
24+
InstallerSha256: 3e911c7ef31c3e1c8594911f3462ddd221475a24af30fb814233978331e8f648
2525
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
2626
AppsAndFeaturesEntries:
2727
- DisplayName: Nushell
28-
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
2928
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
3029
- Architecture: x64
3130
Scope: machine
3231
InstallerSwitches:
3332
Custom: ALLUSERS=1
34-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
35-
InstallerSha256: 0580682DC237E7919347666274BE65377E62115863100341DEC92FEF8E018B2E
33+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
34+
InstallerSha256: 3e911c7ef31c3e1c8594911f3462ddd221475a24af30fb814233978331e8f648
3635
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
3736
AppsAndFeaturesEntries:
3837
- DisplayName: Nushell
39-
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
4038
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
4139
- Architecture: arm64
4240
Scope: user
4341
InstallerSwitches:
4442
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
45-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
46-
InstallerSha256: 37681B3E0E6585E016BFF503F119DA6EA39A6337C882D61164FC44AB075D1D80
43+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
44+
InstallerSha256: fccb3ce296a181df205c5d5a0081b976f822228b5ac2a2b51f3cc1314fc2b665
4745
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
4846
AppsAndFeaturesEntries:
4947
- DisplayName: Nushell
50-
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
5148
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
5249
- Architecture: arm64
5350
Scope: machine
5451
InstallerSwitches:
5552
Custom: ALLUSERS=1
56-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
57-
InstallerSha256: 37681B3E0E6585E016BFF503F119DA6EA39A6337C882D61164FC44AB075D1D80
53+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
54+
InstallerSha256: fccb3ce296a181df205c5d5a0081b976f822228b5ac2a2b51f3cc1314fc2b665
5855
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
5956
AppsAndFeaturesEntries:
6057
- DisplayName: Nushell
61-
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
6258
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
6359
ManifestType: installer
6460
ManifestVersion: 1.10.0

manifests/n/Nushell/Nushell/0.105.1/Nushell.Nushell.installer.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,45 +20,41 @@ Installers:
2020
Scope: user
2121
InstallerSwitches:
2222
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
23-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
24-
InstallerSha256: 1087C8FDF5AD3F2540BEC6DFC246826D2F2F6378C857946B0A0729AAE5DA7C3A
23+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
24+
InstallerSha256: f60bcba3674d737bc8f2ce8a47b6bd9599a846806125795024059f68b3f70565
2525
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
2626
AppsAndFeaturesEntries:
2727
- DisplayName: Nushell
28-
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
2928
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
3029
- Architecture: x64
3130
Scope: machine
3231
InstallerSwitches:
3332
Custom: ALLUSERS=1
34-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
35-
InstallerSha256: 1087C8FDF5AD3F2540BEC6DFC246826D2F2F6378C857946B0A0729AAE5DA7C3A
33+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
34+
InstallerSha256: f60bcba3674d737bc8f2ce8a47b6bd9599a846806125795024059f68b3f70565
3635
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
3736
AppsAndFeaturesEntries:
3837
- DisplayName: Nushell
39-
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
4038
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
4139
- Architecture: arm64
4240
Scope: user
4341
InstallerSwitches:
4442
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
45-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
46-
InstallerSha256: 8B2FBC9F64F792670B9F849897DA101CAAAA9AE753404E02B268AAE8FEA5BEF8
43+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
44+
InstallerSha256: 419e293bb80bbce828ce4c8a323cba6125b8d18e1cc549aa847b480659fe300c
4745
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
4846
AppsAndFeaturesEntries:
4947
- DisplayName: Nushell
50-
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
5148
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
5249
- Architecture: arm64
5350
Scope: machine
5451
InstallerSwitches:
5552
Custom: ALLUSERS=1
56-
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
57-
InstallerSha256: 8B2FBC9F64F792670B9F849897DA101CAAAA9AE753404E02B268AAE8FEA5BEF8
53+
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
54+
InstallerSha256: 419e293bb80bbce828ce4c8a323cba6125b8d18e1cc549aa847b480659fe300c
5855
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
5956
AppsAndFeaturesEntries:
6057
- DisplayName: Nushell
61-
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
6258
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
6359
ManifestType: installer
6460
ManifestVersion: 1.10.0

tests/test-all.nu

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Usage:
2+
# Run the following commands to enable local manifest files and installer hash override with admin privileges:
3+
# winget settings --enable LocalManifestFiles
4+
# winget settings --enable InstallerHashOverride
5+
6+
use common.nu [check-user-install, check-version-match, check-local-machine-install]
7+
8+
const VERSION = '0.105.1'
9+
const PREV_VERSION = '0.105.0'
10+
const LAST_VERSION = '0.105.1'
11+
const MSI_PKG = 'wix\bin\x64\Release\nu-x64.msi'
12+
const PER_MACHINE_INSTALL_DIR = 'C:\Program Files\nu'
13+
const PER_USER_INSTALL_DIR = $'($nu.home-path)\AppData\Local\Programs\nu'
14+
const WINGET_ARGS = [
15+
--silent
16+
--ignore-security-hash
17+
--disable-interactivity
18+
--accept-source-agreements
19+
--accept-package-agreements
20+
]
21+
22+
def main [--msi(-m)] {
23+
if $msi {
24+
test-msi-per-user-install
25+
test-msi-per-machine-install
26+
}
27+
test-winget-per-user-install
28+
test-winget-per-user-upgrade
29+
test-winget-per-machine-install
30+
test-winget-per-machine-upgrade
31+
}
32+
33+
export def test-msi-per-user-install [] {
34+
winget uninstall nushell | complete
35+
print $'Using msiexec to test MSI (ansi g)per-user(ansi reset) installation'
36+
print '-------------------------------------------------------------------'
37+
msiexec /i $MSI_PKG MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt
38+
check-user-install $PER_USER_INSTALL_DIR
39+
check-version-match $VERSION $PER_USER_INSTALL_DIR
40+
winget list nushell --accept-source-agreements
41+
}
42+
43+
export def test-msi-per-machine-install [] {
44+
winget uninstall nushell | complete
45+
print $'(char nl)Using msiexec to test MSI (ansi g)machine scope(ansi reset) installation'
46+
print '-------------------------------------------------------------------'
47+
msiexec /i $MSI_PKG ALLUSERS=1 /L*V install.txt
48+
check-local-machine-install
49+
check-version-match $VERSION $PER_MACHINE_INSTALL_DIR
50+
winget list nushell --accept-source-agreements
51+
}
52+
53+
export def test-winget-per-user-install [] {
54+
winget uninstall nushell | complete
55+
print $'(char nl)Using winget to test MSI (ansi g)user scope(ansi reset) installation'
56+
print '-------------------------------------------------------------------'
57+
winget install --manifest $'manifests\n\Nushell\Nushell\($PREV_VERSION)\' ...$WINGET_ARGS --scope user
58+
check-user-install $PER_USER_INSTALL_DIR
59+
check-version-match $PREV_VERSION $PER_USER_INSTALL_DIR
60+
winget list nushell --accept-source-agreements
61+
}
62+
63+
export def test-winget-per-user-upgrade [] {
64+
print $'(char nl)Using winget to test MSI (ansi g)user scope(ansi reset) upgrade'
65+
print '-------------------------------------------------------------------'
66+
winget install --manifest $'manifests\n\Nushell\Nushell\($LAST_VERSION)\' ...$WINGET_ARGS --scope user
67+
check-user-install $PER_USER_INSTALL_DIR
68+
check-version-match $LAST_VERSION $PER_USER_INSTALL_DIR
69+
winget list nushell --accept-source-agreements
70+
}
71+
72+
export def test-winget-per-machine-install [] {
73+
winget uninstall nushell | complete
74+
print $'(char nl)Using winget to test MSI (ansi g)machine scope(ansi reset) installation'
75+
print '-------------------------------------------------------------------'
76+
winget install --manifest $'manifests\n\Nushell\Nushell\($PREV_VERSION)\' ...$WINGET_ARGS --scope machine
77+
check-local-machine-install
78+
check-version-match $PREV_VERSION $PER_MACHINE_INSTALL_DIR
79+
winget list nushell --accept-source-agreements
80+
}
81+
82+
export def test-winget-per-machine-upgrade [] {
83+
print $'(char nl)Using winget to test MSI (ansi g)machine scope(ansi reset) upgrade'
84+
print '-------------------------------------------------------------------'
85+
winget install --manifest $'manifests\n\Nushell\Nushell\($LAST_VERSION)\' ...$WINGET_ARGS --scope machine
86+
check-local-machine-install
87+
check-version-match $LAST_VERSION $PER_MACHINE_INSTALL_DIR
88+
winget list nushell --accept-source-agreements
89+
}

0 commit comments

Comments
 (0)