Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/test-upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Description: This workflow runs tests for hustcer/deepseek-review.
# REF:
# - https://github.com/vyadh/nutest/blob/main/.github/workflows/tests.yaml
# - https://github.com/fdncred/winget-pkgs/blob/master/doc/manifest/schema/1.10.0/installer.md
# - https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables

name: Run Nushell Upgrade Tests

on:
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
workflow_dispatch:
push:
branches:
- main
- develop
- feature/msi-test
paths-ignore:
- '**.md'
- 'docs/**'
schedule:
- cron: '0 2 * * *' # Run every morning at 2am UTC

permissions:
contents: read

jobs:
default:
name: Install and Upgrade Nushell

strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2025]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install winget
if: ${{ matrix.os == 'windows-latest' }}
uses: Cyberboss/install-winget@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Winget
run: |
winget --version
winget settings --enable LocalManifestFiles
winget settings --enable InstallerHashOverride

- name: Setup Nu
uses: hustcer/setup-nu@v3
with:
version: 'nightly'

- name: Test Nushell Upgrade
shell: nu {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
use ${{ github.workspace }}/tests/test-all.nu *
test-winget-per-user-install
test-winget-per-user-upgrade
test-winget-per-machine-install
test-winget-per-machine-upgrade


20 changes: 8 additions & 12 deletions manifests/n/Nushell/Nushell/0.105.0/Nushell.Nushell.installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,41 @@ Installers:
Scope: user
InstallerSwitches:
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
InstallerSha256: 0580682DC237E7919347666274BE65377E62115863100341DEC92FEF8E018B2E
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
InstallerSha256: 3e911c7ef31c3e1c8594911f3462ddd221475a24af30fb814233978331e8f648
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: x64
Scope: machine
InstallerSwitches:
Custom: ALLUSERS=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
InstallerSha256: 0580682DC237E7919347666274BE65377E62115863100341DEC92FEF8E018B2E
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-x86_64-pc-windows-msvc.msi
InstallerSha256: 3e911c7ef31c3e1c8594911f3462ddd221475a24af30fb814233978331e8f648
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{E5A818C7-FD84-4011-B147-2ADE34D0F940}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: arm64
Scope: user
InstallerSwitches:
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
InstallerSha256: 37681B3E0E6585E016BFF503F119DA6EA39A6337C882D61164FC44AB075D1D80
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
InstallerSha256: fccb3ce296a181df205c5d5a0081b976f822228b5ac2a2b51f3cc1314fc2b665
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: arm64
Scope: machine
InstallerSwitches:
Custom: ALLUSERS=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
InstallerSha256: 37681B3E0E6585E016BFF503F119DA6EA39A6337C882D61164FC44AB075D1D80
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.0/nu-0.105.0-aarch64-pc-windows-msvc.msi
InstallerSha256: fccb3ce296a181df205c5d5a0081b976f822228b5ac2a2b51f3cc1314fc2b665
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{F7F161F2-F0BD-46EF-90D7-602FF59C5A8D}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
ManifestType: installer
ManifestVersion: 1.10.0
20 changes: 8 additions & 12 deletions manifests/n/Nushell/Nushell/0.105.1/Nushell.Nushell.installer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,45 +20,41 @@ Installers:
Scope: user
InstallerSwitches:
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
InstallerSha256: 1087C8FDF5AD3F2540BEC6DFC246826D2F2F6378C857946B0A0729AAE5DA7C3A
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
InstallerSha256: f60bcba3674d737bc8f2ce8a47b6bd9599a846806125795024059f68b3f70565
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: x64
Scope: machine
InstallerSwitches:
Custom: ALLUSERS=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
InstallerSha256: 1087C8FDF5AD3F2540BEC6DFC246826D2F2F6378C857946B0A0729AAE5DA7C3A
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-x86_64-pc-windows-msvc.msi
InstallerSha256: f60bcba3674d737bc8f2ce8a47b6bd9599a846806125795024059f68b3f70565
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{DEE37CEE-80F7-42E4-95ED-92A6E12E19B1}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: arm64
Scope: user
InstallerSwitches:
Custom: ALLUSERS=2 MSIINSTALLPERUSER=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
InstallerSha256: 8B2FBC9F64F792670B9F849897DA101CAAAA9AE753404E02B268AAE8FEA5BEF8
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
InstallerSha256: 419e293bb80bbce828ce4c8a323cba6125b8d18e1cc549aa847b480659fe300c
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
- Architecture: arm64
Scope: machine
InstallerSwitches:
Custom: ALLUSERS=1
InstallerUrl: https://github.com/nushell/nushell/releases/download/0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
InstallerSha256: 8B2FBC9F64F792670B9F849897DA101CAAAA9AE753404E02B268AAE8FEA5BEF8
InstallerUrl: https://github.com/nushell/integrations/releases/download/v0.105.1/nu-0.105.1-aarch64-pc-windows-msvc.msi
InstallerSha256: 419e293bb80bbce828ce4c8a323cba6125b8d18e1cc549aa847b480659fe300c
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
AppsAndFeaturesEntries:
- DisplayName: Nushell
ProductCode: '{61785607-1DF2-4C66-BC98-B01E757FCBB4}'
UpgradeCode: '{82D756D2-19FA-4F09-B10F-64942E89F364}'
ManifestType: installer
ManifestVersion: 1.10.0
89 changes: 89 additions & 0 deletions tests/test-all.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Usage:
# Run the following commands to enable local manifest files and installer hash override with admin privileges:
# winget settings --enable LocalManifestFiles
# winget settings --enable InstallerHashOverride

use common.nu [check-user-install, check-version-match, check-local-machine-install]

const VERSION = '0.105.1'
const PREV_VERSION = '0.105.0'
const LAST_VERSION = '0.105.1'
const MSI_PKG = 'wix\bin\x64\Release\nu-x64.msi'
const PER_MACHINE_INSTALL_DIR = 'C:\Program Files\nu'
const PER_USER_INSTALL_DIR = $'($nu.home-path)\AppData\Local\Programs\nu'
const WINGET_ARGS = [
--silent
--ignore-security-hash
--disable-interactivity
--accept-source-agreements
--accept-package-agreements
]

def main [--msi(-m)] {
if $msi {
test-msi-per-user-install
test-msi-per-machine-install
}
test-winget-per-user-install
test-winget-per-user-upgrade
test-winget-per-machine-install
test-winget-per-machine-upgrade
}

export def test-msi-per-user-install [] {
winget uninstall nushell | complete
print $'Using msiexec to test MSI (ansi g)per-user(ansi reset) installation'
print '-------------------------------------------------------------------'
msiexec /i $MSI_PKG MSIINSTALLPERUSER=1 /quiet /qn /L*V install.txt
check-user-install $PER_USER_INSTALL_DIR
check-version-match $VERSION $PER_USER_INSTALL_DIR
winget list nushell --accept-source-agreements
}

export def test-msi-per-machine-install [] {
winget uninstall nushell | complete
print $'(char nl)Using msiexec to test MSI (ansi g)machine scope(ansi reset) installation'
print '-------------------------------------------------------------------'
msiexec /i $MSI_PKG ALLUSERS=1 /L*V install.txt
check-local-machine-install
check-version-match $VERSION $PER_MACHINE_INSTALL_DIR
winget list nushell --accept-source-agreements
}

export def test-winget-per-user-install [] {
winget uninstall nushell | complete
print $'(char nl)Using winget to test MSI (ansi g)user scope(ansi reset) installation'
print '-------------------------------------------------------------------'
winget install --manifest $'manifests\n\Nushell\Nushell\($PREV_VERSION)\' ...$WINGET_ARGS --scope user
check-user-install $PER_USER_INSTALL_DIR
check-version-match $PREV_VERSION $PER_USER_INSTALL_DIR
winget list nushell --accept-source-agreements
}

export def test-winget-per-user-upgrade [] {
print $'(char nl)Using winget to test MSI (ansi g)user scope(ansi reset) upgrade'
print '-------------------------------------------------------------------'
winget install --manifest $'manifests\n\Nushell\Nushell\($LAST_VERSION)\' ...$WINGET_ARGS --scope user
check-user-install $PER_USER_INSTALL_DIR
check-version-match $LAST_VERSION $PER_USER_INSTALL_DIR
winget list nushell --accept-source-agreements
}

export def test-winget-per-machine-install [] {
winget uninstall nushell | complete
print $'(char nl)Using winget to test MSI (ansi g)machine scope(ansi reset) installation'
print '-------------------------------------------------------------------'
winget install --manifest $'manifests\n\Nushell\Nushell\($PREV_VERSION)\' ...$WINGET_ARGS --scope machine
check-local-machine-install
check-version-match $PREV_VERSION $PER_MACHINE_INSTALL_DIR
winget list nushell --accept-source-agreements
}

export def test-winget-per-machine-upgrade [] {
print $'(char nl)Using winget to test MSI (ansi g)machine scope(ansi reset) upgrade'
print '-------------------------------------------------------------------'
winget install --manifest $'manifests\n\Nushell\Nushell\($LAST_VERSION)\' ...$WINGET_ARGS --scope machine
check-local-machine-install
check-version-match $LAST_VERSION $PER_MACHINE_INSTALL_DIR
winget list nushell --accept-source-agreements
}