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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.yml]
indent_size = 2
27 changes: 27 additions & 0 deletions .github/scripts/e2e-test.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#Requires -Version 5.1

$ErrorActionPreference = 'Stop'

if ($env:CI -ne $true -or $env:GITHUB_ACTIONS -ne $true) {
throw 'This script is intended to be run in GitHub Actions CI environment only'
}

Write-Output "$Env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$WorkingRoot = "$PSScriptRoot\..\.."

# Typical installation
& "$WorkingRoot\install.ps1"
if (-not (Test-Path -Path "$Env:USERPROFILE\.config\scoop\config.json")) {
throw 'Scoop config file should exist after installation'
}
scoop help
Remove-Item -Path "$Env:USERPROFILE\scoop" -Recurse -Force -ErrorAction SilentlyContinue

# Fall back to download zips when git not available
git config --global protocol.https.allow never
# Custom installation directory
$CustomScoopDir = "$Env:USERPROFILE\custom_scoop"
& "$WorkingRoot\install.ps1" -ScoopDir $CustomScoopDir
Write-Output "$CustomScoopDir\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
scoop help
Get-Content -Raw -Path "$env:USERPROFILE\.config\scoop\config.json" | Write-Output
75 changes: 23 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,44 @@
name: Scoop Installer CI Tests
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
test_powershell:
name: WindowsPowerShell
unit_test:
name: Unit Test
runs-on: windows-latest
strategy:
matrix:
shell: [powershell, pwsh]
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
# Need at least 2 commits to properly gather changed files for linting
fetch-depth: 2
- name: Init Test Suite
- name: Install and cache test dependencies
uses: potatoqualitee/psmodulecache@ee5e9494714abf56f6efbfa51527b2aec5c761b8 # v6.2.1
with:
modules-to-cache: PSScriptAnalyzer, BuildHelpers, Pester
shell: powershell
- name: Test Scoop Installer
shell: powershell
shell: ${{ matrix.shell }}
- name: Run tests
run: ./test/bin/test.ps1
- name: Test Scoop Install command
shell: powershell
run: |
./install.ps1 -RunAsAdmin
echo "$Env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test scoop command availability
shell: powershell
run: scoop help
test_pwsh_cloning:
name: PowerShell (with cloning)
e2e_test:
name: E2E Test
runs-on: windows-latest
strategy:
matrix:
shell: [powershell, pwsh]
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2
- name: Init Test Suite
uses: potatoqualitee/psmodulecache@ee5e9494714abf56f6efbfa51527b2aec5c761b8 # v6.2.1
with:
modules-to-cache: PSScriptAnalyzer, BuildHelpers, Pester
shell: pwsh
- name: Test Scoop Installer
shell: pwsh
run: ./test/bin/test.ps1
- name: Test Scoop Install command
shell: pwsh
run: |
./install.ps1 -RunAsAdmin
echo "~\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test scoop command availability
shell: pwsh
run: scoop help
test_pwsh_download:
name: PowerShell (with downloading)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 2
- name: Test Scoop Install command
shell: pwsh
run: |
git config --global protocol.https.allow never
./install.ps1 -RunAsAdmin
echo "~\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test scoop command availability
shell: pwsh
run: scoop help
- name: Run tests
run: ./.github/scripts/e2e-test.ps1
Loading