Skip to content

CI Build

CI Build #42

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI Build
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 1 * *'
jobs:
first_check:
name: first code check / python-3.10 / ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Python info
run: |
which python3
python3 --version
- name: Install dependiencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install mcfly prospector pytest pandas
- name: Check style against standards using prospector (only warn for now, but never fail)
shell: bash -l {0}
run: prospector --profile linter_profile -o grouped -o pylint:pylint-report.txt --zero-exit
- name: Run unit tests
run: pytest -v
basic_checks:
name: Run tests across OS and versions / python-${{ matrix.python-version }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: first_check
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.7', '3.8', '3.9', '3.10']
exclude:
# already tested in first_check job
- python-version: 3.10
os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Python info
run: |
which python
python --version
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip setuptools wheel
python3 -m pip install mcfly prospector pytest pandas
- name: Run unit tests
run: pytest -v