Skip to content

Commit

Permalink
github actions (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehesiod committed Jan 12, 2021
1 parent f37bb79 commit 60a885a
Show file tree
Hide file tree
Showing 5 changed files with 452 additions and 58 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: CI

on:
push:
branches:
- 'master'
tags: [ '[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches:
- 'master'
- '[0-9].[0-9]+.[0-9]+'

jobs:

test:
name: Test
strategy:
matrix:
pyver: [3.8]
os: [ubuntu]
fail-fast: true
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Run unittests
env:
COLOR: 'yes'
run: |
pip install -U setuptools pip
pip install -U pipenv codecov
pipenv lock
pipenv sync --dev
pipenv check || true
pipenv graph
make flake mototest
pre-deploy:
name: Pre-Deploy
runs-on: ubuntu-latest
needs: test
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Dummy
run: |
echo "Predeploy step"
build-tarball:
name: Tarball
runs-on: ubuntu-latest
needs: pre-deploy
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Make sdist
run:
python setup.py sdist
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist

deploy:
name: Deploy
needs: [build-tarball]
runs-on: ubuntu-latest
steps:
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install twine
run: |
python -m pip install twine
- name: Download dists
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ cov cover coverage: flake

# BOTO_CONFIG solves https://github.com/travis-ci/travis-ci/issues/7940
mototest:
BOTO_CONFIG=/dev/null pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov aiobotocore tests
docker pull alpine
docker pull lambci/lambda:python3.8
BOTO_CONFIG=/dev/null pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov --log-cli-level=DEBUG aiobotocore tests
@echo "open file://`pwd`/htmlcov/index.html"


Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage = "==5.0.3"
flake8 = "==3.7.9"
flake8-formatter-abspath = "==1.0.1"
docker = '<4' # fix: client version 1.39 is too new. Maximum supported API version is 1.38
moto = {extras = ["server"],version = "==1.3.14"}
moto = {extras = ["server"],version = "==1.3.16"}
idna = "==2.8" # broken pipenv resolver
pytest = "==5.3.5"
pytest-cov = "==2.8.1"
Expand Down

0 comments on commit 60a885a

Please sign in to comment.