Skip to content

Merge pull request #1 from sdb9696/add_typing #18

Merge pull request #1 from sdb9696/add_typing

Merge pull request #1 from sdb9696/add_typing #18

Workflow file for this run

name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
POETRY_VERSION: 1.6.1
TOX_VERSION: 4.11.3
COVERALLS_VERSION: 3.3.1
jobs:
linting:
name: "Perform linting checks"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Lint with tox
run: |
tox
env:
TOXENV: lint
docs:
name: "Build docs"
needs: linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Make docs with tox
run: |
tox
env:
TOXENV: docs
tests:
name: tests
needs: linting
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
pipx install coveralls==$COVERALLS_VERSION
- name: Prepare toxenv
id: toxenv
run: |
if [[ '${{ matrix.python-version }}' == '3.8' ]]; then
echo "::set-output name=toxenv::py38"
elif [[ '${{ matrix.python-version }}' == '3.9' ]]; then
echo "::set-output name=toxenv::py39"
elif [[ '${{ matrix.python-version }}' == '3.10' ]]; then
echo "::set-output name=toxenv::py310"
elif [[ '${{ matrix.python-version }}' == '3.11' ]]; then
echo "::set-output name=toxenv::py311"
else
echo "::set-output name=toxenv::py312"
fi
- name: Test with tox
run: |
tox
env:
TOXENV: ${{ steps.toxenv.outputs.toxenv }}
- name: Report to Coveralls
run: |
coveralls --service=github
# Only report coverage on latest Python version and skip on prior failures
if: ${{ success() && matrix.python-version == '3.12' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}