Run some automatic tests with GitHub Actions (#68)
This commit is contained in:
62
.github/workflows/ci.yml
vendored
Normal file
62
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
check-code-format:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install module
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install .[dev] --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
- name: Check code format with Black
|
||||
run: |
|
||||
black --check .
|
||||
|
||||
- name: Check imports order with isort
|
||||
run: |
|
||||
isort --check-only .
|
||||
|
||||
- name: Check code style with Flake8
|
||||
if: ${{ always() }}
|
||||
run: |
|
||||
flake8 .
|
||||
|
||||
|
||||
run-tests:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python 3.8
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.8
|
||||
|
||||
- name: Install module
|
||||
run: |
|
||||
pip install wheel
|
||||
pip install .[dev] --extra-index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
- name: Run pytest
|
||||
run: |
|
||||
pytest -v tests/test.py
|
||||
Reference in New Issue
Block a user