-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 2.66 KB
/
pytest-linux.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: pytest linux
on: [push, pull_request]
env:
PYTHONPATH: /home/runner/work/sz-sdk-python-grpc/sz-sdk-python-grpc/src
permissions:
contents: read
jobs:
pytest-linux:
name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
services:
servegrpc:
credentials:
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
env:
SENZING_TOOLS_ENABLE_ALL: true
image: senzing/serve-grpc
options: --user 0
ports:
- 8261:8261
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m venv ./venv
source ./venv/bin/activate
echo "PATH=${PATH}" >> "${GITHUB_ENV}"
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install psutil pytest pytest-cov pytest-schema
- if: matrix.python-version == '3.8' || matrix.python-version == '3.9' || matrix.python-version == '3.10'
name: Install python libraries for python 3.8, 3.9, and 3.10
run: |
source ./venv/bin/activate
python -m pip install typing_extensions
- name: Run pytest on tests
run: |
source ./venv/bin/activate
pytest tests/ --verbose --capture=no --cov=src --cov-append
- name: Run unittest on examples
run: |
source ./venv/bin/activate
python3 -m unittest \
examples/szconfig/*.py \
examples/szconfigmanager/*.py \
examples/szdiagnostic/*.py \
examples/szengine/*.py \
examples/szproduct/*.py \
examples/misc/*.py \
|| true
- name: Rename coverage file
env:
COVERAGE_FILE: "coverage.${{ matrix.python-version }}"
run: |
mv .coverage "$COVERAGE_FILE"
- name: Store coverage file
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.python-version }}
path: coverage.${{ matrix.python-version }}
coverage:
name: Coverage
needs: pytest-linux
permissions:
pull-requests: write
contents: write
uses: senzing-factory/build-resources/.github/workflows/python-coverage-comment.yaml@v2