Skip to content

Commit 99e4b49

Browse files
committed
build(actions): initial commit
1 parent 43e042a commit 99e4b49

File tree

5 files changed

+111
-0
lines changed

5 files changed

+111
-0
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
contact_links:
2+
- name: Discord
3+
url: https://discord.gg/6Q5XW5H
4+
about: Please ask and answer questions here.

.github/workflows/codecov.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Codecov
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@main
14+
- name: Set up Python
15+
uses: actions/setup-python@main
16+
with:
17+
python-version: 3.8
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install pytest coverage pytest-cov
22+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
23+
- name: Generate coverage report
24+
run: |
25+
pytest --cov --cov-report=xml
26+
- name: Upload coverage to Codecov
27+
uses: codecov/codecov-action@master
28+
with:
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
file: ./coverage.xml
31+
flags: unittests

.github/workflows/pre-commit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
branches: [develop, main]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
pre-commit:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@main
15+
- uses: actions/setup-python@main
16+
- uses: pre-commit/[email protected]
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python package
5+
6+
on:
7+
workflow_run:
8+
workflows: ["pre-commit"]
9+
branches: [develop, main]
10+
types:
11+
- completed
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.7, 3.8]
19+
20+
steps:
21+
- uses: actions/checkout@main
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@main
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
pytest
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Semantic Release
2+
3+
on:
4+
workflow_run:
5+
workflows: ["Python package"]
6+
branches: [main]
7+
types:
8+
- completed
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@main
16+
with:
17+
fetch-depth: 0
18+
- name: Python Semantic Release
19+
uses: relekang/python-semantic-release@master
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)