Skip to content

Commit ffdb060

Browse files
Add GitHub Actions workflows
1 parent b9b4c12 commit ffdb060

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish Package on PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
submodules: true
14+
- name: Set up Python
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: 3.9
18+
19+
# Install dependencies using Poetry
20+
- uses: Gr1N/setup-poetry@v8
21+
- uses: actions/cache@v2
22+
with:
23+
path: ~/.cache/pypoetry/virtualenvs
24+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
25+
- run: poetry --version
26+
- run: poetry install
27+
- name: Build and publish package
28+
run: poetry publish --build -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-app.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Test and Lint
5+
6+
on: [push]
7+
8+
jobs:
9+
Pytest:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: 'recursive'
15+
- name: Set up Python 3.11
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.11
19+
- uses: Gr1N/setup-poetry@v8
20+
- uses: actions/cache@v2
21+
with:
22+
path: ~/.cache/pypoetry/virtualenvs
23+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
24+
- run: poetry --version
25+
- run: poetry install
26+
- name: Test with pytest
27+
run: |
28+
poetry run coverage run -m pytest
29+
- name: Generate code coverage report
30+
run: |
31+
poetry run coverage report
32+
33+
Flake8:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
with:
38+
submodules: 'recursive'
39+
- name: Set up Python 3.11
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: 3.11
43+
- uses: Gr1N/setup-poetry@v8
44+
- uses: actions/cache@v2
45+
with:
46+
path: ~/.cache/pypoetry/virtualenvs
47+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
48+
- run: poetry --version
49+
- run: poetry install
50+
- name: Lint with flake8
51+
run: |
52+
poetry run flake8
53+
54+
Mypy:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
with:
59+
submodules: 'recursive'
60+
- name: Set up Python 3.11
61+
uses: actions/setup-python@v4
62+
with:
63+
python-version: 3.11
64+
- uses: Gr1N/setup-poetry@v8
65+
- uses: actions/cache@v2
66+
with:
67+
path: ~/.cache/pypoetry/virtualenvs
68+
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
69+
- run: poetry --version
70+
- run: poetry install
71+
- name: Lint with mypy
72+
run: |
73+
poetry run mypy .

0 commit comments

Comments
 (0)