Skip to content

Commit

Permalink
feat: add github actions for databuilder
Browse files Browse the repository at this point in the history
Signed-off-by: feng-tao <fengtao04@gmail.com>
  • Loading branch information
feng-tao committed Aug 18, 2020
1 parent bfc6f81 commit 9750c1b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

on: pull_request
jobs:
pre-commit:
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
test-unit:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ['3.6.x', '3.7.x']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip3 install -r requirements.txt && pip3 install .[all] && pip3 install codecov
- name: Run python unit tests
run: make test
29 changes: 29 additions & 0 deletions .github/workflows/pypipublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

name: Build and Deploy
on:
push:
branches:
- master
tags:
- '*'
jobs:
build-and-publish-python-module:
name: Build and publish python module to pypi
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.6
uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}

0 comments on commit 9750c1b

Please sign in to comment.