Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean #39

Merged
merged 9 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/actions/python-poetry-env/action.yml

This file was deleted.

77 changes: 42 additions & 35 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Run tests

on:
push:
Expand All @@ -7,45 +7,52 @@ on:
pull_request:

jobs:
actionlint:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- name: Download actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
shell: bash
- name: Check workflow files
run: ./actionlint -color
shell: bash

lint-cruft:
name: Check if automatic project update was successful
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- name: Fail if .rej files exist as structure update was not successful
run: test -z "$(find . -iname '*.rej')"

pre-commit:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python-poetry-env
- run: poetry run pre-commit run --all-files

test:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
python-version: ["3.9", "3.10", "3.11"]

name: Set up Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/python-poetry-env
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
channels: conda-forge, defaults
channel-priority: true
python-version: ${{ matrix.python-version }}
- run: poetry run pytest
auto-update-conda: true

- name: Install kulprit
shell: bash -l {0}
run: |
conda install pip
pip install -r requirements-dev.txt
pip install .
python --version
conda list
pip freeze
- name: Run linters
shell: bash -l {0}
run: |
python -m black kulprit --check
echo "Success!"
echo "Checking code style with pylint..."
python -m pylint kulprit/
- name: Run tests
shell: bash -l {0}
run: |
python -m pytest -vv --cov=kulprit --cov-report=term --cov-report=xml tests
env:
PYTHON_VERSION: ${{ matrix.python-version }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
43 changes: 14 additions & 29 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
fail_fast: true

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
- repo: https://github.com/ambv/black
rev: 22.3.0
hooks:
- id: check-ast
- id: check-added-large-files
- id: check-merge-conflict
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- repo: local
hooks:
- id: autoflake
name: autoflake
entry: poetry run autoflake -r -i --remove-unused-variables
language: system
types: [ python ]
- id: black
name: black
entry: poetry run black
language: system
types: [python]
- id: flake8
name: flake8
entry: poetry run flake8
language: system
types: [python]
- repo: https://github.com/PyCQA/pylint
rev: v2.10.2
hooks:
- id: pylint
args: [--rcfile=.pylintrc]
- repo: https://github.com/MarcoGorelli/madforhooks
rev: 0.3.0
hooks:
- id: no-print-statements

Loading
Loading