Merge branch 'main' of https://github.com/AgrospAI/ocean-runner #69
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: Package testing | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10-alpine", "3.11-alpine", "3.12-alpine", "3.13-alpine"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup and install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| version: "0.6.4" | |
| - name: Setup python | |
| run: uv python install | |
| - name: Run tests and generate coverage | |
| run: uv run pytest --cov=ocean_runner | |
| - name: Generate coverage badge | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.python-version == '3.13-alpine' | |
| run: | | |
| rm -fr coverage.svg | |
| uv run coverage-badge -o coverage.svg | |
| - name: Commit coverage badge | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.python-version == '3.13-alpine' | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "[email protected]" | |
| git add coverage.svg | |
| git diff --cached --quiet || git commit -m "Update coverage badge" | |
| git push |