-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport GitHub workflows to 1.2 branch
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |