upgrade actions #80
This file contains 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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request_target: | |
types: [opened, synchronize, reopened] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
pydantic-version: ["pydantic<2", "pydantic>=2"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Setup pip cache | |
uses: actions/cache@v4 | |
id: pipcache | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-check-manifest | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -e . | |
python -m pip install "${{ matrix.pydantic-version }}" | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Test | |
run: | | |
coverage run -m pytest | |
- name: Publish coverage | |
run: coveralls --service=github | |
env: | |
COVERALLS_PARALLEL: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}-${{ matrix.pydantic-version }} | |
finish: | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
parallel-finished: true |