Skip to content

core: poetry/pre-commits update dependencies + some work on pytest pa… #75

core: poetry/pre-commits update dependencies + some work on pytest pa…

core: poetry/pre-commits update dependencies + some work on pytest pa… #75

Workflow file for this run

name: Test & Lint
on:
pull_request:
push:
branches:
- master
- develop
jobs:
lint_cruft:
name: Check if automatic project update was successful
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Fail if .rej files exist as structure update was not successful
run: test -z "$(find . -iname '*.rej')"
lint:
name: Lint
needs: [lint_cruft]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8.5
- name: Resolve poetry dependency
uses: abatilo/[email protected]
with:
poetry-version: 1.1.4
- name: Install project dependencies
run: poetry install
- name: Lint
run: poetry run pre-commit run -a
test:
name: Test
needs: [lint_cruft]
runs-on: ${{ matrix.platform }}
strategy:
max-parallel: 12
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, 3.10, 3.11, 3.12]
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions coveralls
- name: Test with tox
run: tox
env:
PLATFORM: ${{ matrix.platform }}
- name: Coveralls
# Error: Container action is only supported on Linux
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsif
if: ${{ matrix.platform == 'ubuntu-latest' }}
uses: AndreMiras/coveralls-python-action@develop
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
coveralls_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