Skip to content

Commit b6f8bfd

Browse files
committed
add github actions
1 parent f5448b6 commit b6f8bfd

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
name: Pull Request
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
lint_code:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
python-version: ["3.11"]
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install .[dev]
28+
- name: Analysing the code with pre-commit lint checks
29+
run: |
30+
pre-commit run -a
31+
32+
test_code_python3p8:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
matrix:
36+
python-version: ["3.8"]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- name: Set up Python ${{ matrix.python-version }}
40+
uses: actions/setup-python@v3
41+
with:
42+
python-version: ${{ matrix.python-version }}
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip
46+
pip install .[dev]
47+
- name: Test code
48+
run: |
49+
mkdir test_report
50+
tox
51+
52+
53+
test_code_and_coverage_report_python3p11:
54+
runs-on: ubuntu-latest
55+
strategy:
56+
matrix:
57+
python-version: ["3.11"]
58+
steps:
59+
- uses: actions/checkout@v4
60+
- name: Set up Python ${{ matrix.python-version }}
61+
uses: actions/setup-python@v3
62+
with:
63+
python-version: ${{ matrix.python-version }}
64+
- name: Install dependencies
65+
run: |
66+
python -m pip install --upgrade pip
67+
pip install .[dev]
68+
- name: Test code
69+
run: |
70+
mkdir test_report
71+
tox
72+
- name: html to pdf
73+
uses: fifsky/html-to-pdf-action@master
74+
with:
75+
htmlFile: test_report/cov_report/index.html
76+
outputFile: test_report/cov_report/cov_report.pdf
77+
pdfOptions: '{"format": "A4", "margin": {"top": "10mm", "left": "10mm", "right": "10mm", "bottom": "10mm"}}'
78+
- name: Archive code coverage results
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: code-coverage-report
82+
path: test_report/cov_report/cov_report.pdf

.github/workflows/push_branch.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
2+
name: Push to branch
3+
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
9+
jobs:
10+
test_code:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.12"]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install .[dev]
25+
- name: Test code
26+
run: |
27+
tox

0 commit comments

Comments
 (0)