73 lines
2.0 KiB
YAML
73 lines
2.0 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
check-formatting:
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Consult black on python formatting
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- uses: dschep/install-pipenv-action@v1
|
|
- name: Install dependencies
|
|
run: |
|
|
pipenv install --dev --python ${pythonLocation}/python
|
|
- name: Run black
|
|
run: |
|
|
pipenv run black . --check --diff --exclude tests/output_
|
|
|
|
run-tests:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
python-version: [ '3.6', '3.7' ]
|
|
|
|
name: Python ${{ matrix.python-version }} test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- uses: dschep/install-pipenv-action@v1
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt install protobuf-compiler libprotobuf-dev
|
|
pipenv install --dev --python ${pythonLocation}/python
|
|
- name: Run tests
|
|
run: |
|
|
cp .env.default .env
|
|
pipenv run pip install -e .
|
|
pipenv run generate
|
|
pipenv run test
|
|
|
|
build-release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.7
|
|
- uses: dschep/install-pipenv-action@v1
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt install protobuf-compiler libprotobuf-dev
|
|
pipenv install --dev --python ${pythonLocation}/python
|
|
- name: Build package
|
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
|
|
run: pipenv run python setup.py sdist
|
|
- name: Publish package
|
|
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
|
|
uses: pypa/gh-action-pypi-publish@v1.0.0a0
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.pypi }}
|