Merge pull request #93 from geotribu/dependabot/github_actions/action… #209
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: "🎳 Test" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.py" | |
| - ".github/workflows/tests.yml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "**/*.py" | |
| - ".github/workflows/tests.yml" | |
| - "pyproject.toml" | |
| - "uv.lock" | |
| jobs: | |
| unit-test: | |
| name: "🤞 Unit tests" | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| python-version: | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Get source code | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| cache-dependency-path: "uv.lock" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Install requirements | |
| run: uv sync | |
| - name: Set up Redis | |
| uses: shogo82148/actions-setup-redis@v1 | |
| with: | |
| redis-version: "8" | |
| - name: Unit tests | |
| run: uv run pytest -v --cov --cov-report xml:coverage.xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/[email protected] | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| OS: ${{ matrix.os }} | |
| PYTHON: ${{ matrix.python-version }} | |
| with: | |
| env_vars: OS,PYTHON | |
| flags: unittests | |
| name: Code Coverage for unittests on [${{ matrix.os }}.python-${{ matrix.python-version }}] |