chore: update Makefile and CONTRIBUTING.md #19
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@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: uv.lock | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| 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: | | |
| # Create a directory to store the coverage reports | |
| mkdir -p coverage_output | |
| # Run the container and generate both XML and lcov coverage reports | |
| docker run --rm \ | |
| -v "${{ github.workspace }}/coverage_output":/app/coverage_output \ | |
| sqlnotify:ci \ | |
| bash -lc "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 | |
| run: make publish | |
| env: | |
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
| - name: Compose down | |
| run: docker compose down --remove-orphans |