Skip to content

CI

CI #196

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
schedule:
# run every Monday at 5am UTC
- cron: '0 5 * * 1'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
##########
# And when Guido had called all the people unto him, he said unto them,
# Hearken unto me every one of you, behold PEP-8 and understand;
# To obey is better than to sacrifice!
##########
linter:
name: Code linter
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox -e codestyle --
##########
# Until GA supports step reuse/inheritance or better conditional
# exclusion of matrix targets, this is the shortest way of creating
# our matrix. It's not best because of some duplication and manual
# cranking, but other options require much more duplication.
##########
tests:
name: ${{ matrix.target.env }} (${{ matrix.target.os }})
runs-on: ${{ matrix.target.os }}
needs: linter
strategy:
fail-fast: false
matrix:
target: [
{"os": "macos-latest", "python": "3.9", "env": "py3.9-test"},
{"os": "windows-latest", "python": "3.9", "env": "py3.9-test"},
{"os": "ubuntu-latest", "python": "3.9", "env": "py3.9-test"},
{"os": "ubuntu-latest", "python": "3.8", "env": "py3.8-test"},
{"os": "ubuntu-latest", "python": "3.7", "env": "py3.7-test"},
{"os": "ubuntu-20.04", "python": "3.6", "env": "py3.6-test"},
{"os": "ubuntu-latest", "python": "3.9", "env": "py3.9-test-alldeps-cov"},
# arviz/numpy combination incompatibility with 3.10, to-be-fixed
#{"os": "ubuntu-latest", "python": "3.10", "env": "py3.10-test-alldeps-cov"},
{"os": "ubuntu-latest", "python": "3.10", "env": "py3.10-test-devastropy"},
{"os": "ubuntu-20.04", "python": "3.6", "env": "py3.6-test-oldestdeps"},
{"os": "ubuntu-latest", "python": "3.9", "env": "build_docs"},
]
include:
- toxargs: -v
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.target.python }}
- name: Install minimal TexLive
if: contains('build_docs', matrix.target.env)
# Tex package "type1ec" required (see: matplotlib/issues/16911).
# It's a part of cm-super package fonts and allegedly it's a part
# of tex-extras. Testing shows that docs will *not* compile without
# explicitly installing all 3 though.
run: |
sudo apt update
sudo apt install -y texlive-latex-recommended
sudo apt install -y texlive-latex-extra
sudo apt install -y cm-super
sudo apt install -y dvipng
latex --version
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: tox ${{ matrix.toxargs }} -e ${{ matrix.target.env }} -- ${{ matrix.target.toxargs }}
egg_info:
name: egg_info with Python 3.7
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Run egg_info
run: python setup.py egg_info