Skip to content

Commit

Permalink
Backport GitHub workflows to 1.2 branch
Browse files Browse the repository at this point in the history
  • Loading branch information
lordmauve committed Mar 2, 2021
1 parent 64aebf7 commit d3de3ff
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Python application
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.x
uses: actions/setup-python@v1
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 --count pgzero pgzrun.py test
- name: Install xvfb
run: |
sudo apt-get install xvfb
- name: Run tests under xvfb
run: |
xvfb-run --auto-servernum python setup.py test
- name: Cleanup xvfb pidx
uses: bcomnes/cleanup-xvfb@v1
- uses: actions/upload-artifact@master
with:
name: failed-image
path: test/failed-image
45 changes: 45 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "Build Wheels"

on:
workflow_dispatch:
push:
release:
types:
- published

jobs:
buildpackage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install wheel and SDist requirements
run: python -m pip install "setuptools>=42.0" wheel twine

- name: Build SDist
run: python setup.py sdist bdist_wheel

- uses: actions/upload-artifact@v2
with:
path: |
dist/*.tar.gz
dist/*.whl
publish:
needs: [buildpackage]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

steps:
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist

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

0 comments on commit d3de3ff

Please sign in to comment.