Run some automatic tests with GitHub Actions (#68)

This commit is contained in:
Guillaume Klein
2023-03-22 20:50:03 +01:00
committed by GitHub
parent 52264f2277
commit 66efd02bd0
9 changed files with 143 additions and 2 deletions

62
.github/workflows/ci.yml vendored Normal file
View 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