-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (53 loc) · 1.94 KB
/
pythonpackage.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
54
55
name: Python package
on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '31 13 * * 2'
jobs:
build:
runs-on: ubuntu-latest
environment: test
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
env:
MYGEOTAB_DATABASE: ${{ secrets.MYGEOTAB_DATABASE }}
MYGEOTAB_USERNAME: ${{ secrets.MYGEOTAB_USERNAME }}
MYGEOTAB_PASSWORD: ${{ secrets.MYGEOTAB_PASSWORD }}
MYGEOTAB_SERVER: ${{ secrets.MYGEOTAB_SERVER }}
MYGEOTAB_USERNAME_ASYNC: ${{ secrets.MYGEOTAB_USERNAME_ASYNC }}
MYGEOTAB_PASSWORD_ASYNC: ${{ secrets.MYGEOTAB_PASSWORD_ASYNC }}
steps:
- 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 pip install --upgrade setuptools pip pipenv
pipenv install --skip-lock --dev -e .
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
pipenv run ruff . --select=E9,F63,F7,F82 --show-source
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pipenv run ruff . --exit-zero
- name: Test with pytest
run: |
pipenv run py.test --cov-config .coveragerc --cov-report xml:output/coverage.xml --cov mygeotab --junitxml output/python${{ matrix.python-version }}-test-results.xml --benchmark-min-rounds=3 --benchmark-storage=file://output/ --benchmark-autosave tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./output/coverage.xml
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: output
path: output