-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (51 loc) · 1.64 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
# Allows running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r src/requirements.txt -r tests/requirements.txt .
- name: Run Black
run: black --check .
- name: Run Flake8
run: flake8 .
- name: Run isort
run: isort --check .
- name: Run tests and collect coverage
run: pytest --timeout=300 --junitxml=junit/test-results.xml --cov=relay --cov=tests --cov-report=xml --cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: junit/test-results.xml
# Always run this step, even when there are test failures
if: ${{ always() }}
- name: Upload coverage to https://codecov.io
uses: codecov/codecov-action@v5
# See https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
#
# - name: Build package
# run: python -m build
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}