Add exception handling for latest release checking (#151) #88
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: Run tests on Git-Mastery | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| test-e2e: | |
| name: E2E Tests (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.13"] | |
| steps: | |
| # Ubuntu uses a separate PAT to avoid race conditions when multiple runners hit GitHub simultaneously | |
| - name: Set GH_TOKEN (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| env: | |
| GH_PAT: ${{ secrets.GH_PAT_UBUNTU }} | |
| run: echo "GH_TOKEN=$GH_PAT" >> $GITHUB_ENV | |
| - name: Set GH_TOKEN (non-Ubuntu) | |
| if: matrix.os != 'ubuntu-latest' | |
| shell: bash | |
| env: | |
| GH_PAT: ${{ secrets.GH_PAT }} | |
| run: echo "GH_TOKEN=$GH_PAT" >> $GITHUB_ENV | |
| - name: Validate GH_TOKEN | |
| shell: bash | |
| run: | | |
| if [ -z "$GH_TOKEN" ]; then | |
| echo "Required PAT secret is missing for ${{ matrix.os }}." | |
| exit 1 | |
| fi | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync | |
| - name: Build binary | |
| run: | | |
| uv run pyinstaller --onefile main.py --name gitmastery | |
| - name: Set binary path (Unix) | |
| if: runner.os != 'Windows' | |
| run: echo "GITMASTERY_BINARY=${{ github.workspace }}/dist/gitmastery" >> $GITHUB_ENV | |
| - name: Set binary path (Windows) | |
| if: runner.os == 'Windows' | |
| run: echo "GITMASTERY_BINARY=${{ github.workspace }}/dist/gitmastery.exe" >> $env:GITHUB_ENV | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Run E2E tests | |
| run: | | |
| uv run pytest tests/e2e/ -v |