refactor: add logging for the unhandled errors for Notifier #26
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: Build and Test SQLNotify | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| COMPOSE_DOCKER_CLI_BUILD: 1 | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: uv.lock | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: ".python-version" | |
| - name: Build Docker image | |
| run: | | |
| docker build -t sqlnotify:ci . | |
| - name: Run tests and collect coverage inside Docker | |
| run: | | |
| mkdir -p coverage_output | |
| docker compose up -d postgres | |
| docker compose run --rm \ | |
| -v "${{ github.workspace }}/coverage_output":/app/coverage_output \ | |
| sqlnotify \ | |
| bash -lc "uv run pytest --cov=sqlnotify --cov-report=xml:/app/coverage_output/coverage.xml --cov-report=lcov:/app/coverage_output/lcov.info" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage_output/coverage.xml | |
| fail_ci_if_error: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Publish to PyPI | |
| if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| run: | | |
| docker run --rm -e PYPI_TOKEN="${{ secrets.PYPI_TOKEN }}" sqlnotify:ci \ | |
| bash -lc "uv build && uv publish -t \"$PYPI_TOKEN\"" | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| - name: Compose down | |
| run: docker compose down --remove-orphans |