Skip to content

Commit 8d137ef

Browse files
authored
Merge pull request #3 from ramonaoptics/add_github_ci
Add github workflows to test thing
2 parents a36747b + 96d96a1 commit 8d137ef

File tree

3 files changed

+62
-7
lines changed

3 files changed

+62
-7
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+
# Uncomment below once tests for filelock 3.11 are fixed
15+
# python-version: ['3.7', '3.9', '3.11']
16+
python-version: ['3.9']
17+
18+
steps:
19+
- uses: actions/checkout@v1
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install tox tox-gh-actions
28+
- name: Test with tox
29+
run: tox run -e ${{ matrix.python-version }}

tox.ini

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
[tox]
2-
envlist = py37, py38, py39, flake8
3-
4-
[travis]
5-
python =
6-
3.7: py37
7-
3.8: py38
8-
3.9: py39
2+
envlist = 3.7, 3.8, 3.9, 3.10, 3.11, flake8
93

104
[testenv:flake8]
115
basepython = python
@@ -19,6 +13,7 @@ setenv =
1913
PYTHONPATH = {toxinidir}
2014
deps =
2115
-r{toxinidir}/requirements_dev.txt
16+
3.9: filelock==3.10.7
2217
; If you want to make tox run the tests with the same versions, create a
2318
; requirements.txt with the pinned versions and uncomment the following line:
2419
; -r{toxinidir}/requirements.txt

0 commit comments

Comments
 (0)