Skip to content

Commit b7d2366

Browse files
author
Anton Benkevich
committed
Add test and deploy workflows
1 parent ea8489c commit b7d2366

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

.github/workflows/release_pypi.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test and release to PyPi
5+
on:
6+
push:
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+'
9+
release:
10+
types:
11+
- created
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.7, 3.8, 3.9]
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install ./
29+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30+
- name: Test
31+
run: |
32+
python3 -m unittest
33+
deploy:
34+
needs: test
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Set up Python
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: '3.x'
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install setuptools wheel twine>=3.3.0
46+
- name: Build and publish
47+
env:
48+
TWINE_USERNAME: __token__
49+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
50+
run: |
51+
python setup.py sdist bdist_wheel
52+
twine upload --skip-existing dist/*

.github/workflows/test_all.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test
5+
6+
on:
7+
push:
8+
tags-ignore:
9+
- 'v[0-9]+.[0-9]+.[0-9]+'
10+
branches:
11+
- '**'
12+
pull_request:
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: [3.7, 3.8, 3.9]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install ./
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Test
32+
run: |
33+
echo "$GITHUB_REF"
34+
python3 -m unittest
35+
python3 scripts/validate_my_definition.py -d alsdkdefs/apis/assets_query/

0 commit comments

Comments
 (0)