-
Notifications
You must be signed in to change notification settings - Fork 15
48 lines (46 loc) · 1.3 KB
/
build-python.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
name: Python
on:
workflow_call:
workflow_dispatch:
pull_request:
paths:
- "python/**"
- "proto/**"
- ".github/workflows/*python*"
- "devops/**"
push:
branches:
- main
paths:
- "python/**"
- "proto/**"
- ".github/workflows/*python*"
- "devops/**"
jobs:
build-and-test-python:
name: Test Python code
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
python-version: ['3.10']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Build, Test, Pack
run: |
python -m pip install -r requirements.txt
python -m pip install pytest pytest-cov
python -m pytest --cache-clear ./tests --cov=./ --cov-report=xml
shell: pwsh
working-directory: python
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
TEST_SERVER_ENDPOINT: ${{ secrets.TEST_SERVER_ENDPOINT }}
TEST_SERVER_PORT: ${{ secrets.TEST_SERVER_PORT }}
TEST_SERVER_USE_TLS: ${{ secrets.TEST_SERVER_USE_TLS }}