Skip to content

Commit b52f8b9

Browse files
committed
Add github settings
1 parent bd43255 commit b52f8b9

File tree

4 files changed

+120
-0
lines changed

4 files changed

+120
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Context
2+
-
3+
4+
## Changes
5+
-

.github/workflows/check_code.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Check Code
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
static-analysis:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.9
16+
17+
- uses: snok/[email protected]
18+
with:
19+
virtualenvs-create: true
20+
virtualenvs-in-project: true
21+
22+
- name: Cache Dependencies
23+
uses: actions/cache@v2
24+
id: cache-dependencies
25+
with:
26+
path: .venv
27+
key: venv-${{ runner.os }}-${{ hashFiles('./poetry.lock') }}
28+
29+
- name: Install Dependencies if cache doesn't hit
30+
if: steps.cache-dependencies.cache-hit != 'true'
31+
run: poetry install
32+
33+
- name: Check Code Styles
34+
run: poetry run invoke check-code-style
35+
36+
- name: Check Types
37+
run: poetry run invoke check-types

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release Package to PyPI
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
with:
11+
fetch-depth: 0
12+
- name: Set up Python 3.9
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.9
16+
17+
- uses: snok/[email protected]
18+
with:
19+
virtualenvs-create: true
20+
virtualenvs-in-project: true
21+
22+
- name: Cache Dependencies
23+
uses: actions/cache@v2
24+
id: cache-dependencies
25+
with:
26+
path: .venv
27+
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
28+
29+
- name: Install Dependencies if cache doesn't hit
30+
if: steps.cache-dependencies.cache-hit != 'true'
31+
run: poetry install
32+
33+
- name: Publish to PyPI
34+
run:
35+
poetry config http-basic.pypi ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }};
36+
poetry run invoke release ${{ github.event.release.name }}

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Set up Python 3.9
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.9
19+
20+
- uses: snok/[email protected]
21+
with:
22+
virtualenvs-create: true
23+
virtualenvs-in-project: true
24+
25+
- name: Cache Dependencies
26+
uses: actions/cache@v2
27+
id: cache-dependencies
28+
with:
29+
path: .venv
30+
key: venv-${{ runner.os }}-${{ hashFiles('./poetry.lock') }}
31+
32+
- name: Install Dependencies if cache doesn't hit
33+
if: steps.cache-dependencies.cache-hit != 'true'
34+
run: poetry install
35+
36+
- name: Run test
37+
run: poetry run pytest --cov=. --cov-report=xml
38+
39+
- name: Upload Code Coverage
40+
run: bash <(curl -s https://codecov.io/bash)
41+
env:
42+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)