One-Liner Installer Test #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: One-Liner Installer Test | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to test (e.g., v2.5.9)" | |
| required: false | |
| default: "" | |
| 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: "Linux (Ubuntu)" | |
| os: ubuntu-latest | |
| method: bash-sh | |
| - 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 | |
| env: | |
| CORTEX_VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| case "${{ matrix.method }}" in | |
| bash-sh) | |
| echo "Testing via Bash installer..." | |
| 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 |