-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (50 loc) · 1.36 KB
/
python-client.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
name: python-client
on:
push:
paths:
- 'python-client/**'
- '.github/workflows/python-client.yml'
branches:
- main
pull_request:
paths:
- 'python-client/**'
- '.github/workflows/python-client.yml'
jobs:
test-and-deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
shell: bash
working-directory: python-client
steps:
- name: Checkout repo
uses: actions/checkout@v2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install pinned dependencies
run: |
pip install -r requirements.txt
- name: Install
run: |
pip install -e .
- name: Install Annotate Test Results Plugin
run: pip install pytest-github-actions-annotate-failures
- name: Test
run: |
pytest
- name: Package 📦
if: github.ref == 'refs/heads/main'
run: |
python setup.py sdist
- name: Publish 📦 to PyPI
if: github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
user: __token__
password: ${{ secrets.NTSJENKINS_PYPI }}
packages_dir: python-client/dist