Skip to content

Commit

Permalink
dynamic testing
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mnich committed May 14, 2024
1 parent 8b09be6 commit e3846b6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ name: Test Manifest

on:
workflow_dispatch:
push:
branches:
- manifesttest
inputs:
PackageIdentifier:
description: "Package Identifier"
required: true

jobs:
test:
Expand All @@ -18,5 +19,5 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Test Script
run: .\Scripts\Test-Manifest.ps1 -Manifest .\TestManifests\GitButler\0.11.7
run: .\Scripts\Test-Manifest.ps1 -ManifestURL ${{inputs.PackageIdentifier}}
#run: .\Scripts\Test-Manifest.ps1-Script {winget install Git.Git --accept-source-agreements}
18 changes: 13 additions & 5 deletions Scripts/Test-Manifest.ps1
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
Param(
[Parameter(Position = 0, HelpMessage = 'The Manifest to install in the Sandbox.')]
[String] $Manifest,
[String] $ManifestURL,
[Parameter(Position = 1, HelpMessage = 'The script to run in the Sandbox.')]
[ScriptBlock] $Script,
[Parameter(HelpMessage = 'The folder to map in the Sandbox.')]
[String] $MapFolder = $pwd,
[switch] $SkipManifestValidation,
[switch] $Prerelease,
[switch] $EnableExperimentalFeatures,
[string] $WinGetVersion,
[Parameter(HelpMessage = 'Additional options for WinGet')]
[string] $WinGetOptions
)

#$Manifest = ".\GitButler\0.11.2\"
$SplittedURL = $ManifestURL -split '/'
#$version = $SplittedURL[-1]
$package = $SplittedURL[-2]
#download installer
$Manifest = New-Item -ItemType Directory -Path (Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'ManifestDownload')
Invoke-WebRequest -Uri "$ManifestURL\$package.yaml" -OutFile "$Manifest\$package.yaml"
Invoke-WebRequest -Uri "$ManifestURL\$package.yaml" -OutFile "$Manifest\$package.installer.yaml"
Invoke-WebRequest -Uri "$ManifestURL\$package.yaml" -OutFile "$Manifest\$package.locale.en-US.yaml"





function Update-EnvironmentVariables {
foreach ($level in "Machine", "User") {
Expand Down

0 comments on commit e3846b6

Please sign in to comment.