diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02fd1748..094447fb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,6 +10,12 @@ jobs: test: runs-on: ubuntu-latest + # Required for publish-unit-test-result-action to post check runs and PR comments + permissions: + contents: read + checks: write + pull-requests: write + steps: - uses: actions/checkout@v4 @@ -22,4 +28,30 @@ jobs: run: pip install -e ".[dev]" - name: Run tests - run: pytest --cov=src --cov-report=term-missing + run: | + pytest \ + --tb=short \ + --cov=src \ + --cov-report=term-missing \ + --cov-report=xml:reports/coverage.xml \ + --junitxml=reports/junit.xml + + # Posts a check annotation + PR comment showing pass/fail counts. + # Visible in the GitHub mobile app under Checks and in PR conversations. + - name: Publish test results + uses: EnricoMi/publish-unit-test-result-action@v2 + if: always() + with: + files: reports/junit.xml + check_name: "pytest results" + comment_title: "Test Results" + report_individual_runs: true + + # Coverage report available as a downloadable artifact in the Actions tab + - name: Upload coverage report + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report + path: reports/coverage.xml + retention-days: 14 diff --git a/.gitignore b/.gitignore index 7415281b..ff2474cb 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ env/ .pytest_cache/ .coverage htmlcov/ +reports/ # IDE .idea/ diff --git a/README.md b/README.md index fe356be0..ce078a71 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Timmy Time — Mission Control +[![Tests](https://github.com/Alexspayne/Timmy-time-dashboard/actions/workflows/tests.yml/badge.svg)](https://github.com/Alexspayne/Timmy-time-dashboard/actions/workflows/tests.yml) + A local-first dashboard for your sovereign AI agents. Talk to Timmy, watch his status, verify Ollama is running — all from a browser, no cloud required. ---