Skip to content

Commit

Permalink
Merge pull request #96 from wichmann-lab/fixCI
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
otizonaizit authored Sep 19, 2024
2 parents 8af584b + 1c80b0a commit 7cd7411
Showing 1 changed file with 30 additions and 53 deletions.
83 changes: 30 additions & 53 deletions .github/workflows/ci-tests.yml
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

0 comments on commit 7cd7411

Please sign in to comment.