Skip to content

Commit ff8210d

Browse files
author
Tomasz Szymański
committed
github action with build and publish test
1 parent f87cfd3 commit ff8210d

4 files changed

Lines changed: 112 additions & 53 deletions

File tree

.github/workflows/package.yml

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

.github/workflows/publish.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
env:
12+
PYTHONPATH: ./storages
13+
STORAGES_AWS_ACCESS_KEY_ID: ${{ secrets.STORAGES_AWS_ACCESS_KEY_ID }}
14+
STORAGES_AWS_SECRET_ACCESS_KEY: ${{ secrets.STORAGES_AWS_SECRET_ACCESS_KEY }}
15+
STORAGES_BUCKET_NAME: ${{ secrets.STORAGES_BUCKET_NAME }}
16+
STORAGES_PATH: ${{ secrets.STORAGES_PATH }}
17+
STORAGES_BACKEND: ${{ secrets.STORAGES_BACKEND }}
18+
strategy:
19+
matrix:
20+
python-version: [3.6, 3.7, 3.8, 3.9]
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install mypy flake8 pytest pytest-cov pytest-xdist boto3
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 ./storages/ --count --show-source --statistics
35+
- name: Check type hints with mypy
36+
run: |
37+
mypy ./storages/
38+
- name: Test with pytest
39+
run: |
40+
python -m pytest -n 5 --cov-report=xml --cov=storages/
41+
- uses: codecov/codecov-action@v1
42+
with:
43+
files: ./coverage.xml
44+
fail_ci_if_error: true
45+
name: simple-storage
46+
verbose: true
47+
build-and-publish:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Setup Python 3.9
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: 3.9
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
python -m pip install build twine
59+
- name: Build a binary wheel and a source tarball
60+
run: |
61+
python -m build --sdist --wheel --outdir dist/
62+
- name: Publish distribution to PyPI
63+
uses: pypa/gh-action-pypi-publish@master
64+
with:
65+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: test and lint
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- master
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
env:
12+
PYTHONPATH: ./storages
13+
STORAGES_AWS_ACCESS_KEY_ID: ${{ secrets.STORAGES_AWS_ACCESS_KEY_ID }}
14+
STORAGES_AWS_SECRET_ACCESS_KEY: ${{ secrets.STORAGES_AWS_SECRET_ACCESS_KEY }}
15+
STORAGES_BUCKET_NAME: ${{ secrets.STORAGES_BUCKET_NAME }}
16+
STORAGES_PATH: ${{ secrets.STORAGES_PATH }}
17+
STORAGES_BACKEND: ${{ secrets.STORAGES_BACKEND }}
18+
strategy:
19+
matrix:
20+
python-version: [3.6, 3.7, 3.8, 3.9]
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install mypy flake8 pytest pytest-cov pytest-xdist boto3
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 ./storages/ --count --show-source --statistics
35+
- name: Check type hints with mypy
36+
run: |
37+
mypy ./storages/
38+
- name: Test with pytest
39+
run: |
40+
python -m pytest -n 5 --cov-report=xml --cov=storages/
41+
- uses: codecov/codecov-action@v1
42+
with:
43+
files: ./coverage.xml
44+
fail_ci_if_error: true
45+
name: simple-storage
46+
verbose: true

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = simple-storage
3-
version = 0.0.2
3+
version = 0.0.3
44
author = Merixstudio
55
author_email = code@merixstudioc.om
66
description = File storage made easy

0 commit comments

Comments
 (0)