deps: bump dependencies #93
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: Run tests and pretty files | |
| on: | |
| push: | |
| branches: [main] | |
| tags-ignore: ['**'] | |
| paths: | |
| - '.github/workflows/test.yml' | |
| - 'python_weather/**/*.py' | |
| - 'tests/*.py' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/test.yml' | |
| - 'python_weather/**/*.py' | |
| - 'tests/*.py' | |
| workflow_dispatch: null | |
| jobs: | |
| test: | |
| name: Run tests and pretty files | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ['3.10', 3.11, 3.12, 3.13, 3.14] | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 2 | |
| - name: Setup Python | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| - name: Install test dependencies | |
| run: | | |
| python3 -m pip install .[dev] | |
| - name: Install ruff | |
| if: ${{ matrix.python-version == 3.14 }} | |
| run: python3 -m pip install ruff | |
| - name: Run tests | |
| run: python3 -m pytest -x --cov=python_weather --cov-report term-missing --cov-report=xml --junitxml=junit.xml | |
| - name: Upload coverage results to Codecov | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: codecov/codecov-action@v7 | |
| with: | |
| files: ./coverage.xml | |
| flags: python-${{ matrix.python-version }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| files: ./junit.xml | |
| flags: python-${{ matrix.python-version }} | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload coverage results to Codacy | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: codacy/codacy-coverage-reporter-action@v1 | |
| with: | |
| coverage-reports: coverage.xml | |
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
| - name: Lint files | |
| if: ${{ matrix.python-version == 3.14 }} | |
| run: python3 -m ruff check | |
| - name: Pretty files | |
| if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.14 }} | |
| run: python3 -m ruff format | |
| - name: Import GPG key | |
| if: ${{ github.event_name != 'pull_request' && matrix.python-version == 3.14 }} | |
| uses: crazy-max/ghaction-import-gpg@v7 | |
| with: | |
| gpg_private_key: ${{ secrets.CI_GPG_PRIVATE_KEY }} | |
| passphrase: ${{ secrets.CI_GPG_PASS }} | |
| git_user_signingkey: true | |
| git_commit_gpgsign: true | |
| - name: Push new commit | |
| if: ${{ github.event_name == 'workflow_dispatch' && matrix.python-version == 3.14 }} | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| commit: -S | |
| message: 'chore: update python-weather from manually invoked CI' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Override HEAD commit | |
| if: ${{ github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch' && matrix.python-version == 3.14 }} | |
| uses: EndBug/add-and-commit@v10 | |
| with: | |
| commit: -S --amend --no-edit --no-reset-author | |
| message: ${{ github.event.head_commit.message }} | |
| push: --force-with-lease | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |