-
Notifications
You must be signed in to change notification settings - Fork 80
63 lines (54 loc) · 1.7 KB
/
testing-and-deployment.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
56
57
58
59
60
61
62
63
on:
pull_request:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
jobs:
unit_testing:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
env:
KEEPAKEY: ${{ secrets.KEEPAKEY }}
WEAKKEEPAKEY: ${{ secrets.WEAKKEEPAKEY }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
**/setup.py
**/requirements*.txt
- name: Install
run: |
python setup.py sdist
pip install dist/*.tar.gz --disable-pip-version-check
cd tests/
python -c "import keepa"
- name: Validate Keys
run: |
python -c "import os, keepa; keepa.Keepa(os.environ.get('KEEPAKEY'))"
- name: Unit testing
run: |
pip install -r requirements_test.txt --disable-pip-version-check
cd tests
pytest -v --cov keepa --cov-report xml
- uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11'
name: 'Upload coverage to codecov'
- name: Upload to PyPi
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
run: |
pip install twine
python setup.py sdist
twine upload --skip-existing dist/keepa*.tar.gz
env: # Or as an environment variable
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"