| 1 |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 |
|
| 4 |
name: Dominate |
| 5 |
on: |
| 6 |
push: |
| 7 |
branches: ["master"] |
| 8 |
pull_request: |
| 9 |
branches: ["master"] |
| 10 |
|
| 11 |
jobs: |
| 12 |
test: |
| 13 |
runs-on: ${{ matrix.os }} |
| 14 |
strategy: |
| 15 |
fail-fast: false |
| 16 |
matrix: |
| 17 |
python: ["3"] |
| 18 |
os: ["ubuntu-latest"] |
| 19 |
include: |
| 20 |
- {python: "3.7", os: "ubuntu-22.04"} |
| 21 |
- {python: "3.8", os: "ubuntu-22.04"} |
| 22 |
- {python: "3.9", os: "ubuntu-22.04"} |
| 23 |
- {python: "3.10", os: "ubuntu-22.04"} |
| 24 |
- {python: "3.11", os: "ubuntu-22.04"} |
| 25 |
- {python: "3.12", os: "ubuntu-22.04"} |
| 26 |
steps: |
| 27 |
- uses: actions/checkout@v3 |
| 28 |
- name: "Set up Python ${{ matrix.python }}" |
| 29 |
uses: actions/setup-python@v3 |
| 30 |
with: |
| 31 |
python-version: ${{ matrix.python }} |
| 32 |
- name: "Install dependencies" |
| 33 |
run: | |
| 34 |
# python -m pip install --upgrade pip |
| 35 |
python -m pip install pytest |
| 36 |
python -m pip install mock |
| 37 |
python -m pip install flake8 |
| 38 |
python -m pip install importlib_metadata |
| 39 |
python -m pip install "setuptools>=62" |
| 40 |
python -m pip install wheel |
| 41 |
python -m pip install build |
| 42 |
- name: "Lint with flake8" |
| 43 |
run: | |
| 44 |
# stop the build if there are Python syntax errors or undefined names |
| 45 |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 46 |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics |
| 47 |
- name: "Build and test" |
| 48 |
run: | |
| 49 |
python -m build --no-isolation |
| 50 |
pip install dist/dominate*.tar.gz |
| 51 |
pytest |
| 52 |
- name: Coveralls |
| 53 |
env: |
| 54 |
COVERAGE_RCFILE: ".github/workflows/.coveragerc" |
| 55 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 56 |
run: | |
| 57 |
python -m pip install coverage |
| 58 |
python -m pip install coveralls |
| 59 |
coverage run --source=dominate -m pytest |
| 60 |
python -m coveralls --service=github || true |