harden manifest scheduler #154
Workflow file for this run
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 soliplex unit tests / linting | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| paths-filter: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_test: ${{ steps.filter.outputs.python }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| python: | |
| - 'pyproject.toml' | |
| - 'src/soliplex/**' | |
| - 'tests/**' | |
| - '.github/workflows/soliplex.yaml' | |
| - 'uv.lock' | |
| test: | |
| needs: paths-filter | |
| if: needs.paths-filter.outputs.should_test == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Run unit tests | |
| run: uv run pytest | |
| lint: | |
| needs: paths-filter | |
| if: needs.paths-filter.outputs.should_test == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.13 | |
| - name: Install dependencies | |
| run: uv sync --group dev | |
| - name: Check formatting | |
| run: uv run ruff format --check | |
| - name: Check linting | |
| run: uv run ruff check | |
| # This job always runs and provides a status for branch protection | |
| # It succeeds if checks passed OR if checks were skipped (no relevant changes) | |
| # Named "test-soliplex" to match existing branch protection rule | |
| test-soliplex: | |
| runs-on: ubuntu-latest | |
| needs: [paths-filter, test, lint] | |
| if: always() | |
| steps: | |
| - name: Check results | |
| run: | | |
| if [[ "${{ needs.paths-filter.outputs.should_test }}" != "true" ]]; then | |
| echo "Checks skipped - no relevant file changes" | |
| exit 0 | |
| elif [[ "${{ needs.test.result }}" == "success" && "${{ needs.lint.result }}" == "success" ]]; then | |
| echo "All checks passed" | |
| exit 0 | |
| else | |
| echo "Checks failed: test=${{ needs.test.result }}, lint=${{ needs.lint.result }}" | |
| exit 1 | |
| fi | |
| notify-failure: | |
| runs-on: ubuntu-latest | |
| needs: [test, lint] | |
| if: failure() | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Notify Slack on failure | |
| uses: slackapi/slack-github-action@v3.0.1 | |
| with: | |
| webhook: ${{ secrets.SLACK_NOTIFY_URL }} | |
| webhook-type: incoming-webhook | |
| payload: | | |
| { | |
| "channel": "#soliplex", | |
| "username": "soliplex", | |
| "text": ":x: ${{ github.workflow }} failed on ${{ github.head_ref || github.ref_name }}:\n${{ github.event.head_commit.message }}\nhttps://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | |
| "icon_emoji": ":ghost:" | |
| } |