-
Notifications
You must be signed in to change notification settings - Fork 32
54 lines (54 loc) · 1.72 KB
/
ci.yaml
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
54
name: ci
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build:
continue-on-error: True
runs-on: ubuntu-latest
strategy:
matrix:
# https://devguide.python.org/versions/#python-release-cycle
# TODO: Support 3.10+
python-version: [3.7,3.8,3.9]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
python -m pip install build --user
- name: Build
run: python -m build
- name: Upload distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-${{ matrix.python-version }}
path: dist/
# - name: Lint with Ruff
# run: |
# pip install ruff
# ruff --output-format=github --target-version=py37 python_logging_rabbitmq
# continue-on-error: true
- name: Test with pytest
run: |
python -m pytest \
--doctest-modules \
--junitxml=junit/test-results-${{ matrix.python-version }}.xml \
--cov=com \
--cov-report=xml \
--cov-report=html
- name: Upload pytest test results
uses: actions/upload-artifact@v3
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
if: ${{ always() }}