Skip to content

chore(deps): update actions/setup-python action to v7 #3217

chore(deps): update actions/setup-python action to v7

chore(deps): update actions/setup-python action to v7 #3217

Workflow file for this run

name: CI
on:
push:
pull_request_target:
jobs:
authorize:
name: Authorize
runs-on: ubuntu-latest
# Use 'external' environment for forks to require manual approval
# Use 'internal' for local branches/pushes (no approval needed)
environment: >-
${{ (github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository) &&
'external' || 'internal' }}
steps:
- run: true
quality:
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/cache@v6
with:
path: ~/.cache/pre-commit
key: pre-commit-${{hashFiles('.pre-commit-config.yaml')}}
- name: Set up the environment
uses: ./.github/actions/setup-python-env
- name: Regenerate requirements.txt
run: |
uv export --no-hashes --output-file=requirements.txt
uv export --no-hashes --only-group=docs --output-file=docs/requirements.txt
- name: Commit changes if needed
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
run: |
if ! git diff --quiet requirements.txt docs/requirements.txt; then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add requirements.txt docs/requirements.txt
git diff --staged --quiet || git commit -m "chore: update requirements.txt files"
git push origin HEAD:${{ github.event.pull_request.head.ref || github.ref_name }}
fi
- name: Run pre-commit
run: uv run pre-commit run -a --show-diff-on-failure
- name: Check lock file consistency
run: uv sync --locked
tests-and-type-check:
needs: authorize
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
defaults:
run:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Set up the environment
uses: ./.github/actions/setup-python-env
with:
python-version: ${{matrix.python-version}}
- name: Create credentials.json for DVC Remote
env:
GDRIVE_CREDENTIALS_DATA: ${{ secrets.GDRIVE_CREDENTIALS_DATA }}
run: echo $GDRIVE_CREDENTIALS_DATA > credentials.json
- name: Modify DVC Remote
run: uv run dvc remote modify --local myremote credentialpath credentials.json
- name: Cache DVC
uses: actions/cache@v6
with:
path: .dvc/cache
key: dvc-cache-${{ hashFiles('**/dvc.lock') }}
restore-keys: |
dvc-cache-
- name: DVC Pull Data
run: uv run dvc pull -v
- name: Run tests
run: uv run python -m pytest tests --cov --cov-config=pyproject.toml --cov-report=xml -m "not fails_gha"
env:
SOCCERDATA_DIR: tests/appdata
- name: Check typing
run: uv run mypy --install-types --non-interactive --config-file pyproject.toml soccerdata tests
- name: Upload coverage reports to Codecov with GitHub Action on Python 3.11 for Ubuntu
uses: codecov/codecov-action@v7
if: ${{matrix.python-version == '3.11'}}
check-docs:
needs: authorize
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14" # match what's in .readthedocs.yml
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y pandoc
- name: Set up Python environment as in RTD
run: |
python -m pip install --upgrade pip
pip install .
pip install -r docs/requirements.txt # as defined in .readthedocs.yml
- name: Build the documentation
run: |
sphinx-build -b html docs docs/_build/html