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

Add CI #15

Merged
merged 3 commits into from
Feb 21, 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
53 changes: 53 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
# run on every push to main
push:
branches:
- main
# run on every push (not commit) to a PR, plus open/reopen
pull_request:
types:
- synchronize
- opened
- reopened

jobs:
build:
name: Build & test (${{ matrix.python-version }} | ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
# continue testing other configurations even if a matrix job fails
fail-fast: false
matrix:
# latest python on Win/Mac/Lin
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.10"]
# test older python versions on Linux only
include:
- os: ubuntu-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.8"

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy>=1.0 pytest
python -m pip install .

- name: mypy
if: always()
run: mypy --strict .

- name: Run tests
if: always()
run: pytest .
35 changes: 35 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: lint

on:
# run on every push to main
push:
branches:
- main
raehik marked this conversation as resolved.
Show resolved Hide resolved
# run on every push (not commit) to a PR, plus open/reopen
pull_request:
types:
- synchronize
- opened
- reopened

jobs:
various:
name: various (Black, pylint, pydocstyle)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install black pylint pydocstyle

# annotate each step with `if: always` to run all regardless
- name: Assert that code matches Black code style
if: always()
uses: psf/black@stable
- name: Lint with pylint
if: always()
run: pylint .
- name: Lint with pydocstyle
if: always()
run: pydocstyle --convention=numpy .