forked from scylladb/python-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.82 KB
/
test-python2.yaml
File metadata and controls
59 lines (49 loc) · 1.82 KB
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
name: Build and test python2
on: [push, pull_request]
jobs:
test:
name: Test on python2
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python2.7
with:
python-version: '2.7'
- name: Run unittests
run: |-
pip install -r ./test-requirements.txt
pytest --import-mode append ./tests/unit -k 'not (test_connection_initialization or test_cloud)'
EVENT_LOOP_MANAGER=gevent pytest --import-mode append ./tests/unit/io/test_geventreactor.py
EVENT_LOOP_MANAGER=eventlet pytest --import-mode append ./tests/unit/io/test_eventletreactor.py
build:
name: Build source/wheel distribution for python2
if: "(!contains(github.event.pull_request.labels.*.name, 'disable-test-build'))|| github.event_name == 'push' && endsWith(github.event.ref, 'scylla')"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
name: Install Python2.7
with:
python-version: '2.7'
- name: Build sdist
run: python setup.py sdist
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build, test]
runs-on: ubuntu-20.04
# upload to PyPI on every tag starting with 'v'
if: github.event_name == 'push' && endsWith(github.event.ref, 'scylla')
# alternatively, to publish when a GitHub Release is created, use the following rule:
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}