Skip to content

fix(ci): correct PowerShell syntax in Windows verification step #13

fix(ci): correct PowerShell syntax in Windows verification step

fix(ci): correct PowerShell syntax in Windows verification step #13

name: One-Liner Installer Test
on:
workflow_dispatch:
push:
paths:
- "install.sh"
- "install.ps1"
- ".github/workflows/one-liner-test.yml"
pull_request:
paths:
- "install.sh"
- "install.ps1"
jobs:
test-installer:
name: Test on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: "Ubuntu (Debian)"
os: ubuntu-latest
method: bash-sh
- name: "Fedora (RPM)"
os: ubuntu-latest
method: docker-fedora
- name: "macOS (Intel)"
os: macos-12
method: bash-sh
- name: "macOS (Apple Silicon)"
os: macos-latest
method: bash-sh
- name: "Windows (PowerShell)"
os: windows-latest
method: powershell-ps1
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup Rust (Fallback Build Test)
uses: dtolnay/rust-toolchain@stable
- name: Run Installer
shell: bash
run: |
case "${{ matrix.method }}" in
bash-sh)
echo "Testing via Bash installer..."
bash install.sh
;;
docker-fedora)
echo "Testing on Fedora via Docker..."
docker run --rm -v $(pwd):/workspace -w /workspace fedora:latest bash -c "dnf install -y grep findutils curl python3 && bash install.sh"
;;
powershell-ps1)
echo "Testing via PowerShell installer..."
powershell -ExecutionPolicy Bypass -File install.ps1
;;
esac
- name: Verify Installation
shell: bash
run: |
if [ "${{ matrix.method }}" == "powershell-ps1" ]; then
# Windows verification needs powershell context if run via bash
powershell -Command "
\$env:Path += \";\$env:USERPROFILE\.local\bin\"
cortex --version
cortex init
"
else
# Ensure bin dir is in path for the rest of the job
export PATH="$HOME/.local/bin:$PATH"
echo "Checking version..."
cortex --version
echo "Checking init..."
cortex init
fi