feat: modernize Python tooling (pyproject.toml + uv + semantic-release) #1574
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: Python CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: | |
| - '**' | |
| workflow_call: | |
| jobs: | |
| run_tests: | |
| name: Tests | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.12'] | |
| toxenv: [quality, data-django42, reporting-django42] | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: setup python | |
| uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Set env variable | |
| run: export AWS_CONFIG_FILE=/dev/null | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2 | |
| - name: Install Dependencies | |
| run: uv sync --group ci | |
| - name: Install GNU gettext | |
| run: sudo apt-get install gettext | |
| - name: Run Tests | |
| env: | |
| TOXENV: ${{ matrix.toxenv }} | |
| run: uv run tox | |
| - name: Run Coverage | |
| if: matrix.python-version == '3.12' && (matrix.toxenv=='django42-data' || matrix.toxenv=='django42-reporting') | |
| uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unittests | |
| fail_ci_if_error: true |