Skip to content

Commit

Permalink
tests: reimport old tests + add linting setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwu10 authored and nikhiljha committed Apr 30, 2022
1 parent ff82ecd commit 182ff75
Show file tree
Hide file tree
Showing 7 changed files with 622 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
max-line-length = 88
extend-ignore = E203, E501
extend-ignore = E203, E501
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI
on:
push:
branches: [main]
tags:
- v*
pull_request:

jobs:
lint:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry --version
poetry install --no-interaction
- name: Lint
run: poetry run pre-commit run --all-files

test:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
poetry --version
poetry install --no-interaction
- name: Test
run: poetry run coverage run -m pytest

- name: Prepare coverage report
run: poetry run coverage xml

- name: Upload coverage reports
uses: codecov/codecov-action@v2
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# End of https://www.toptal.com/developers/gitignore/api/python,macos
# End of https://www.toptal.com/developers/gitignore/api/python,macos
41 changes: 41 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-json
- id: check-toml
- id: check-yaml
- id: check-merge-conflict
- id: debug-statements
- id: name-tests-test
- repo: local
# run all of these hooks from the Poetry versions
hooks:
- id: isort
name: isort
entry: poetry run isort
language: system
types: [python]
require_serial: true
- id: black
name: black
entry: poetry run black
language: system
types: [python]
require_serial: true
- id: flake8
name: flake8
entry: poetry run flake8
language: system
types: [python]
require_serial: true
- id: mypy
name: mypy
entry: poetry run mypy
args: ["--scripts-are-modules"]
language: system
types: [python]
require_serial: true
Loading

0 comments on commit 182ff75

Please sign in to comment.