Installation Tests #312
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: Installation Tests | |
| on: | |
| schedule: | |
| # Run daily at 5AM UTC (7AM Warsaw CET, 6AM CEST) | |
| - cron: '0 5 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'pyproject.toml' | |
| - '.github/workflows/installation-tests.yml' | |
| pull_request: | |
| paths: | |
| - 'pyproject.toml' | |
| - '.github/workflows/installation-tests.yml' | |
| concurrency: | |
| group: installation-tests | |
| cancel-in-progress: true | |
| jobs: | |
| test-macos-15-curl: | |
| runs-on: macos-15 | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.local/bin/uv | |
| ~/.local/bin/uvx | |
| ~/Library/Caches/uv | |
| key: uv-macos-15-curl-${{ github.run_id }} | |
| restore-keys: | | |
| uv-macos-15-curl- | |
| - name: Install uv via curl | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: | | |
| if [ -f "$HOME/.local/bin/uv" ]; then | |
| echo "uv already cached, skipping download" | |
| else | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| fi | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via curl, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| test-macos-15-homebrew: | |
| runs-on: macos-15 | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/Library/Caches/uv | |
| key: uv-macos-15-homebrew-${{ github.run_id }} | |
| restore-keys: | | |
| uv-macos-15-homebrew- | |
| - name: Install uv via Homebrew | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: brew install uv | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via Homebrew, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| # NOTE: macOS 14 tests disabled - too slow (15+ minutes) and causing CI timeouts | |
| # TODO: Re-enable when GitHub Actions macOS 14 runners are faster | |
| # test-macos-14-curl: | |
| # runs-on: macos-14 | |
| # ... | |
| # test-macos-14-homebrew: | |
| # runs-on: macos-14 | |
| # ... | |
| test-ubuntu-24-curl: | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.local/bin/uv | |
| ~/.local/bin/uvx | |
| ~/.cache/uv | |
| key: uv-ubuntu-24-${{ github.run_id }} | |
| restore-keys: | | |
| uv-ubuntu-24- | |
| - name: Install uv via curl | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: | | |
| if [ -f "$HOME/.local/bin/uv" ]; then | |
| echo "uv already cached, skipping download" | |
| else | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| fi | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via curl, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| test-ubuntu-22-curl: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.local/bin/uv | |
| ~/.local/bin/uvx | |
| ~/.cache/uv | |
| key: uv-ubuntu-22-${{ github.run_id }} | |
| restore-keys: | | |
| uv-ubuntu-22- | |
| - name: Install uv via curl | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: | | |
| if [ -f "$HOME/.local/bin/uv" ]; then | |
| echo "uv already cached, skipping download" | |
| else | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| fi | |
| echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via curl, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| test-windows-latest-powershell: | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~\.local\bin\uv.exe | |
| ~\.local\bin\uvx.exe | |
| ${{ env.LOCALAPPDATA }}\uv\cache | |
| key: uv-windows-x64-${{ github.run_id }} | |
| restore-keys: | | |
| uv-windows-x64- | |
| - name: Capture environment info | |
| shell: powershell | |
| run: | | |
| Write-Host "=== Python Details ===" | |
| python --version | |
| python -c "import struct; print(f'Architecture: {struct.calcsize(chr(80)) * 8}-bit')" | |
| python -c "import sys; print(f'Executable: {sys.executable}')" | |
| - name: Install uv via PowerShell | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: | | |
| if (Test-Path "$env:USERPROFILE\.local\bin\uv.exe") { | |
| Write-Host "uv already cached, skipping download" | |
| } else { | |
| irm https://astral.sh/uv/install.ps1 | iex | |
| } | |
| echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| shell: powershell | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| shell: powershell | |
| run: echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| shell: bash | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via PowerShell, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| # Windows with Python 3.12 - tests newer Python version compatibility | |
| test-windows-py312: | |
| runs-on: windows-latest | |
| timeout-minutes: 30 | |
| continue-on-error: true | |
| outputs: | |
| result: ${{ steps.final-status.outputs.result }} | |
| failed_steps: ${{ steps.final-status.outputs.failed_steps }} | |
| steps: | |
| - name: Checkout code | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v6 | |
| - name: Cache uv | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~\.local\bin\uv.exe | |
| ~\.local\bin\uvx.exe | |
| ${{ env.LOCALAPPDATA }}\uv\cache | |
| key: uv-windows-py312-${{ github.run_id }} | |
| restore-keys: | | |
| uv-windows-py312- | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| architecture: 'x64' | |
| - name: Capture environment info | |
| shell: powershell | |
| run: | | |
| Write-Host "=== Python Details ===" | |
| python --version | |
| python -c "import struct; print(f'Architecture: {struct.calcsize(chr(80)) * 8}-bit')" | |
| python -c "import sys; print(f'Executable: {sys.executable}')" | |
| - name: Install uv via PowerShell | |
| id: install-uv | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: | | |
| if (Test-Path "$env:USERPROFILE\.local\bin\uv.exe") { | |
| Write-Host "uv already cached, skipping download" | |
| } else { | |
| irm https://astral.sh/uv/install.ps1 | iex | |
| } | |
| echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Verify uv installation | |
| id: verify-uv | |
| continue-on-error: true | |
| shell: powershell | |
| run: uv --version | |
| - name: Set install source | |
| id: source | |
| shell: bash | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "pkg=." >> $GITHUB_OUTPUT | |
| else | |
| echo "pkg=shotgun-sh@latest" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Test ephemeral execution - version | |
| id: test-uvx-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --version | |
| - name: Test ephemeral execution - help | |
| id: test-uvx-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uvx --from "${{ steps.source.outputs.pkg }}" shotgun --help | |
| - name: Test permanent installation | |
| id: test-uv-tool-install | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: uv tool install "${{ steps.source.outputs.pkg }}" | |
| - name: Add uv tools to PATH | |
| shell: powershell | |
| run: echo "$env:USERPROFILE\.local\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Test installed binary - version | |
| id: test-installed-version | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: shotgun --version | |
| - name: Test installed binary - help | |
| id: test-installed-help | |
| continue-on-error: true | |
| timeout-minutes: 30 | |
| shell: powershell | |
| run: shotgun --help | |
| - name: Record final status | |
| id: final-status | |
| if: always() | |
| shell: bash | |
| run: | | |
| failed="" | |
| [[ "${{ steps.install-uv.outcome }}" == "failure" ]] && failed="${failed}Install uv via PowerShell, " | |
| [[ "${{ steps.verify-uv.outcome }}" == "failure" ]] && failed="${failed}Verify uv installation, " | |
| [[ "${{ steps.test-uvx-version.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --version, " | |
| [[ "${{ steps.test-uvx-help.outcome }}" == "failure" ]] && failed="${failed}uvx shotgun --help, " | |
| [[ "${{ steps.test-uv-tool-install.outcome }}" == "failure" ]] && failed="${failed}uv tool install shotgun-sh, " | |
| [[ "${{ steps.test-installed-version.outcome }}" == "failure" ]] && failed="${failed}shotgun --version, " | |
| [[ "${{ steps.test-installed-help.outcome }}" == "failure" ]] && failed="${failed}shotgun --help, " | |
| if [[ -n "$failed" ]]; then | |
| echo "result=failure" >> $GITHUB_OUTPUT | |
| echo "failed_steps=${failed%, }" >> $GITHUB_OUTPUT | |
| exit 1 | |
| else | |
| echo "result=success" >> $GITHUB_OUTPUT | |
| echo "failed_steps=" >> $GITHUB_OUTPUT | |
| fi | |
| notify-slack: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-macos-15-curl | |
| - test-macos-15-homebrew | |
| - test-ubuntu-24-curl | |
| - test-ubuntu-22-curl | |
| - test-windows-latest-powershell | |
| - test-windows-py312 | |
| if: always() && github.event_name == 'schedule' | |
| steps: | |
| - name: Build test results summary | |
| id: summary | |
| run: | | |
| # Check which tests failed | |
| FAILED_TESTS="" | |
| PASSED_TESTS="" | |
| # macOS 15 (Sequoia, Apple Silicon) - curl | |
| if [[ "${{ needs.test-macos-15-curl.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *macOS 15 Sequoia (M1) - curl*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-macos-15-curl.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ macOS 15 Sequoia (M1) - curl\n" | |
| fi | |
| # macOS 15 (Sequoia, Apple Silicon) - Homebrew | |
| if [[ "${{ needs.test-macos-15-homebrew.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *macOS 15 Sequoia (M1) - Homebrew*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-macos-15-homebrew.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ macOS 15 Sequoia (M1) - Homebrew\n" | |
| fi | |
| # macOS 14 tests disabled - too slow | |
| # Skipping test-macos-14-curl and test-macos-14-homebrew | |
| # Ubuntu 24.04 - curl | |
| if [[ "${{ needs.test-ubuntu-24-curl.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *Ubuntu 24.04 - curl*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-ubuntu-24-curl.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ Ubuntu 24.04 - curl\n" | |
| fi | |
| # Ubuntu 22.04 - curl | |
| if [[ "${{ needs.test-ubuntu-22-curl.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *Ubuntu 22.04 - curl*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-ubuntu-22-curl.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ Ubuntu 22.04 - curl\n" | |
| fi | |
| # Windows latest - PowerShell (Python 3.11) | |
| if [[ "${{ needs.test-windows-latest-powershell.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *Windows latest - Python 3.11*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-windows-latest-powershell.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ Windows latest - Python 3.11\n" | |
| fi | |
| # Windows latest - Python 3.12 | |
| if [[ "${{ needs.test-windows-py312.outputs.result }}" == "failure" ]]; then | |
| FAILED_TESTS="${FAILED_TESTS}❌ *Windows latest - Python 3.12*\n" | |
| FAILED_TESTS="${FAILED_TESTS} • Failed: \`${{ needs.test-windows-py312.outputs.failed_steps }}\`\n\n" | |
| else | |
| PASSED_TESTS="${PASSED_TESTS}✅ Windows latest - Python 3.12\n" | |
| fi | |
| # Save to output | |
| echo "failed_tests<<EOF" >> $GITHUB_OUTPUT | |
| echo -e "$FAILED_TESTS" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| echo "passed_tests<<EOF" >> $GITHUB_OUTPUT | |
| echo -e "$PASSED_TESTS" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| # Determine overall status | |
| if [[ -n "$FAILED_TESTS" ]]; then | |
| echo "overall_status=failure" >> $GITHUB_OUTPUT | |
| else | |
| echo "overall_status=success" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Send success notification to Slack | |
| if: steps.summary.outputs.overall_status == 'success' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SHOTGUN_ALPHA_WEBHOOK }} | |
| run: | | |
| cat <<EOF > /tmp/slack_payload.json | |
| { | |
| "blocks": [ | |
| { | |
| "type": "header", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "✅ Shotgun Installation Tests Passed", | |
| "emoji": true | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "*Don't worry, the shotgun is installable!*\n\nAll installation methods verified:\n\n${{ steps.summary.outputs.passed_tests }}\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Test Results>" | |
| } | |
| } | |
| ] | |
| } | |
| EOF | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data @/tmp/slack_payload.json \ | |
| "$SLACK_WEBHOOK_URL" | |
| - name: Send failure notification to Slack | |
| if: steps.summary.outputs.overall_status == 'failure' | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.SHOTGUN_ALPHA_WEBHOOK }} | |
| run: | | |
| cat <<EOF > /tmp/slack_payload.json | |
| { | |
| "blocks": [ | |
| { | |
| "type": "header", | |
| "text": { | |
| "type": "plain_text", | |
| "text": "🚨 Shotgun Installation Tests FAILED", | |
| "emoji": true | |
| } | |
| }, | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "<!channel> *ALERT: Shotgun installation is broken!*\n\n*Failed Tests:*\n\n${{ steps.summary.outputs.failed_tests }}*Passed Tests:*\n${{ steps.summary.outputs.passed_tests }}\n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Full Test Results>" | |
| } | |
| } | |
| ] | |
| } | |
| EOF | |
| curl -X POST -H 'Content-type: application/json' \ | |
| --data @/tmp/slack_payload.json \ | |
| "$SLACK_WEBHOOK_URL" | |
| - name: Fail workflow if tests failed | |
| if: steps.summary.outputs.overall_status == 'failure' | |
| run: exit 1 | |
| heartbeat: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - test-macos-15-curl | |
| - test-macos-15-homebrew | |
| - test-ubuntu-24-curl | |
| - test-ubuntu-22-curl | |
| - test-windows-latest-powershell | |
| - test-windows-py312 | |
| if: >- | |
| always() && | |
| (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| steps: | |
| - name: Determine test result | |
| id: result | |
| run: | | |
| if [[ "${{ needs.test-macos-15-curl.outputs.result }}" == "failure" ]] || | |
| [[ "${{ needs.test-macos-15-homebrew.outputs.result }}" == "failure" ]] || | |
| [[ "${{ needs.test-ubuntu-24-curl.outputs.result }}" == "failure" ]] || | |
| [[ "${{ needs.test-ubuntu-22-curl.outputs.result }}" == "failure" ]] || | |
| [[ "${{ needs.test-windows-latest-powershell.outputs.result }}" == "failure" ]] || | |
| [[ "${{ needs.test-windows-py312.outputs.result }}" == "failure" ]]; then | |
| echo "status=fail" >> $GITHUB_OUTPUT | |
| else | |
| echo "status=ok" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Ping BetterStack heartbeat | |
| env: | |
| BETTERSTACK_HEARTBEAT_URL: ${{ secrets.BETTERSTACK_HEARTBEAT_URL }} | |
| run: | | |
| if [[ -z "$BETTERSTACK_HEARTBEAT_URL" ]]; then | |
| echo "::warning::BETTERSTACK_HEARTBEAT_URL secret not set, skipping heartbeat" | |
| exit 0 | |
| fi | |
| if [[ "${{ steps.result.outputs.status }}" == "ok" ]]; then | |
| curl -sf "$BETTERSTACK_HEARTBEAT_URL" | |
| echo "Heartbeat pinged: OK" | |
| else | |
| curl -sf "$BETTERSTACK_HEARTBEAT_URL/fail" | |
| echo "Heartbeat pinged: FAIL" | |
| fi |