Skip to content

Commit 2dcc626

Browse files
committed
ci: Add GitHub Actions configuration files for CI and Release
1 parent fa19407 commit 2dcc626

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

.github/workflows/release.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
name: release
3+
4+
on:
5+
release:
6+
types: [released]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: [3.6, 3.7, 3.8, 3.9]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
if [ -f requirements-release.txt ]; then pip install -r requirements-release.txt; fi
30+
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.
36+
flake8 . --exclude tests --ignore E301,E302,E303,E305,W391 --count --exit-zero --max-complexity=10 --max-line-length=300 --statistics
37+
38+
- name: Test with pytest & Collect coverage
39+
run: |
40+
pytest -v tests --cov=src.csvdiff3 --cov-report=term-missing --cov-report=html
41+
42+
- name: Make coverage badge
43+
if: ${{ matrix.python-version==3.9 }}
44+
run: |
45+
coverage-badge -o ./htmlcov/coverage.svg
46+
47+
- name: Upload coverage-report to GitHub Pages
48+
if: ${{ matrix.python-version==3.9 }}
49+
uses: peaceiris/actions-gh-pages@v3
50+
with:
51+
github_token: ${{ secrets.GITHUB_TOKEN }}
52+
publish_dir: ./htmlcov

.github/workflows/testing.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
name: testing
3+
4+
on:
5+
pull_request:
6+
branches: [main, develop]
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: [3.6, 3.7, 3.8, 3.9]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
if [ -f requirements-testing.txt ]; then pip install -r requirements-testing.txt; fi
30+
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.
36+
flake8 . --exclude tests --ignore E301,E302,E303,E305,W391 --count --exit-zero --max-complexity=10 --max-line-length=300 --statistics
37+
38+
- name: Test with pytest & Collect coverage
39+
run: |
40+
pytest -v tests --cov=src.csvdiff3 --cov-report=term-missing

0 commit comments

Comments
 (0)