-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from wichmann-lab/fixCI
Fix CI
- Loading branch information
Showing
1 changed file
with
30 additions
and
53 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,36 @@ | ||
# 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 | ||
# This workflow will install Python dependencies and run tests with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
name: Test | ||
|
||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master, refactor-api ] | ||
pull_request: | ||
branches: [ master, refactor-api ] | ||
on: | ||
push | ||
|
||
jobs: | ||
build: | ||
test: | ||
name: ${{ matrix.os}} / py${{ matrix.python_version }} | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.7] | ||
include: | ||
- platform: ubuntu-latest | ||
python-version: 3.8 | ||
runs-on: ${{ matrix.platform }} | ||
os: [Ubuntu] | ||
python_version: ['3.10', '3.11', '3.12'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install package with dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[tests] | ||
# Uncomment if sphinx docs are available in the repository | ||
# pip install -e .[tests,docs] | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
# E9: Runtime errors (syntax, indentation, io) | ||
# F63: Wrong use of operators and always-true assertion tests | ||
# F7: Wrong position of statements (break, continue, return, ...) | ||
# F82: Undefined (variable) name | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# | ||
# print warnings if other style errors are found. | ||
# see .flake8 config file for selected/ignored rules. | ||
# warnings can be found in the action logs https://github.com/wichmann-lab/python-psignifit/actions | ||
flake8 . --count --exit-zero --statistics --show-source | ||
- name: Test with pytest and measure coverage | ||
run: | | ||
pytest --cov --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
env_vars: OS,PYTHON | ||
# Uncomment if sphinx docs are available in the repository | ||
# - name: Build the documentation | ||
# run: | | ||
# python setup.py build_sphinx | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
name: Install Python ${{ matrix.python_version }} | ||
with: | ||
python-version: ${{ matrix.python_version }} | ||
architecture: x64 | ||
|
||
- name: Install (testing) requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
pip install pytest | ||
- name: Install psignifit to be tested | ||
run: | | ||
pip install . | ||
- name: Run tests for ${{ matrix.python_version }} through nox | ||
run: | | ||
pytest -vv | ||