Skip to content

SurroBIER

SurroBIER #87

# 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: Install & Test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch: # starting manually
jobs:
build:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # fetch full commit history & tags (required for automatic versioning)
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up install environment & pytest
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel
- name: Install package
run: |
USE_FORTRAN=1 python -m pip install -e .[dev]
- name: Test with pytest
run: |
pytest
coverage lcov
- name: Collect coverage
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.github_token }}
flag-name: python-${{ matrix.python-version }}
parallel: true
path-to-lcov: "coverage.lcov"
finish:
name: Finish
needs: build
runs-on: ubuntu-latest
steps:
- name: Publish Coverage on Coveralls
uses: coverallsapp/github-action@1.1.3
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true