Skip to content

Commit

Permalink
Merge pull request #1687 from locustio/github-actions-tests
Browse files Browse the repository at this point in the history
Verify docker build & create PyPI releases through Github Actions when tags are pushed
  • Loading branch information
heyman authored Jan 22, 2021
2 parents e9adfd7 + 3aec8cc commit 32a75ef
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,41 @@ jobs:
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- run: pip install tox codecov
- run: tox -e ${{ matrix.tox }}

verify_docker_build:
name: Verify Docker image build
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: false
tags: locustio/locust:latest

release:
name: Release to PyPI
needs: verify_docker_build
if: startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: Publish to PyPI (Test)

uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 32a75ef

Please sign in to comment.