Skip to content

Migrate from pre-commit to PreK #1521

Migrate from pre-commit to PreK

Migrate from pre-commit to PreK #1521

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint
name: Test
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
prek:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: "3.14"
- name: Install prek
run: pip install prek==0.2.28
- name: Run prek
run: prek run --all-files
build:
runs-on: ubuntu-latest
needs: prek
strategy:
matrix:
python-version:
- "3.13"
- "3.14"
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Upload coverage data
if: ${{ matrix.python-version == '3.14' }}
uses: "actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" # v7
with:
name: coverage-data
path: "coverage.xml"
coverage:
runs-on: ubuntu-latest
needs: build
steps:
- name: Check out the repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- name: Download coverage data
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: coverage-data
- name: Upload coverage report
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
token: ${{ secrets.CODECOV_TOKEN }}