Use GH action instead of Travis #3
Workflow file for this run
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
# GH Actions script to test Pyzo. | |
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
lint-build: | |
name: Test linting | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U ruff | |
- name: Ruff lint | |
run: | | |
ruff check --output-format=github . | |
- name: Ruff format | |
run: | | |
ruff format --check . | |
doc-build: | |
name: Test docs | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U sphinx | |
- name: Build docs | |
run: | | |
cd docs | |
make html SPHINXOPTS="-W --keep-going" | |
test-builds: | |
name: Test ${{ matrix.os }} py${{ matrix.pyversion }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
pyversion: '3.13' | |
- os: macos-latest | |
pyversion: '3.13' | |
# | |
- os: ubuntu-latest | |
pyversion: '3.13' | |
- os: ubuntu-latest | |
pyversion: '3.12' | |
- os: ubuntu-latest | |
pyversion: '3.11' | |
- os: ubuntu-latest | |
pyversion: '3.10' | |
- os: ubuntu-latest | |
pyversion: '3.9' | |
# No earlier Python 3.x versions available. | |
# Would love to test on Python 2.7, but not possible with actions/setup-python@v | |
# I also tried an alt action, but it gave an error related to sqlite. | |
# Should work on 2.7 though, since I did not change the logic since it was | |
# last tested on 2.7 ;) | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.pyversion }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pyversion }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U pytest pytest-cov | |
- name: Install in development mode | |
run: | | |
pip install -e . | |
- name: Test on repo | |
run: | | |
pytest -v tests |