Skip to content

Commit 6db62b7

Browse files
authored
Merge pull request #187 from colinoflynn/github_workflows_for_upload
Add flake8 testing on github actions
2 parents ce48c63 + 1a041af commit 6db62b7

File tree

3 files changed

+60
-21
lines changed

3 files changed

+60
-21
lines changed

.github/workflows/pypi.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
2+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
3+
4+
on:
5+
- push
6+
7+
jobs:
8+
build-n-publish:
9+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
10+
if: startsWith(github.ref, 'refs/tags')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
with:
15+
# https://github.com/actions/checkout#fetch-all-history-for-all-tags-and-branches
16+
fetch-depth: 0
17+
- name: Set up Python
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: "3.10"
21+
- name: Install pypa/build
22+
run: python -m pip install build --user
23+
- name: Build a binary wheel and a source tarball
24+
run: python -m build --sdist --wheel --outdir dist/ .
25+
- name: Publish distribution 📦 to PyPI
26+
uses: pypa/gh-action-pypi-publish@release/v1
27+
with:
28+
user: __token__
29+
password: ${{ secrets.PYPI_API_TOKEN }}
30+
print_hash: true
31+
verify_metadata: true

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.7', '3.11']
15+
16+
steps:
17+
- uses: actions/checkout@v1
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
python -m pip install flake8 numpy
26+
- name: Test with tox
27+
run: |
28+
flake8 picoscope setup.py
29+
flake8 examples/*

.travis.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)