Skip to content

Commit c60372f

Browse files
authored
chore: inital workflow (#322)
1 parent d64f15e commit c60372f

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
on: pull_request
3+
4+
jobs:
5+
test:
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 1
15+
- uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install Poetry
19+
uses: snok/install-poetry@v1
20+
with:
21+
virtualenvs-create: true
22+
virtualenvs-in-project: true
23+
installer-parallel: true
24+
- name: Load cached venv
25+
id: cached-poetry-dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: .venv
29+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
30+
- name: Install dependencies
31+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
32+
run: poetry install --no-interaction --no-root
33+
34+
#----------------------------------------------
35+
# run ruff
36+
#----------------------------------------------
37+
- name: Linter with ruff
38+
run: |
39+
ruff .
40+
#----------------------------------------------
41+
# run black
42+
#----------------------------------------------
43+
- name: Linter with black
44+
run: |
45+
black . --check --diff
46+
#----------------------------------------------
47+
# run test suite
48+
#----------------------------------------------
49+
- name: Run tests
50+
run: |
51+
poetry shell
52+
pytest

0 commit comments

Comments
 (0)