Skip to content

Commit 04bd8a4

Browse files
authored
Create reusable workflow called base_ci.yml (#380)
1 parent 6f3f079 commit 04bd8a4

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/base_ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Reusable Continuous Integration Workflow
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
unit-tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [ '3.9', '3.10', '3.11' ]
11+
steps:
12+
- uses: actions/checkout@v3
13+
- name: Install Python ${{ matrix.python-version }}
14+
uses: actions/setup-python@v3
15+
with:
16+
python-version: ${{ matrix.python-version }}
17+
cache: 'pip'
18+
cache-dependency-path: 'pyproject.toml'
19+
- name: Install dependencies
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install .
23+
- name: test
24+
run: pytest
25+
format:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- uses: actions/checkout@v3
29+
- name: Install Python 3
30+
uses: actions/setup-python@v3
31+
with:
32+
python-version: 3.9
33+
- name: format
34+
uses: pre-commit/action@v3.0.0
35+
with:
36+
extra_args: black --all-files
37+
isort:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
- name: Install Python 3
42+
uses: actions/setup-python@v3
43+
with:
44+
python-version: 3.9
45+
- name: isort
46+
uses: pre-commit/action@v3.0.0
47+
with:
48+
extra_args: isort --all-files
49+
lint:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v3
53+
- name: Install Python 3
54+
uses: actions/setup-python@v3
55+
with:
56+
python-version: 3.9
57+
- name: lint
58+
uses: pre-commit/action@v3.0.0
59+
with:
60+
extra_args: flake8 --all-files
61+
- name: lint-pep585-compliant
62+
uses: pre-commit/action@v3.0.0
63+
with:
64+
extra_args: upgrade-type-hints --all-files
65+
typecheck:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v3
69+
- name: Install Python 3
70+
uses: actions/setup-python@v3
71+
with:
72+
python-version: 3.9
73+
- name: mypy
74+
uses: pre-commit/action@v3.0.0
75+
with:
76+
extra_args: mypy --all-files
77+
markdownlint:
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v3
81+
- name: Install Node
82+
uses: actions/setup-node@v3
83+
with:
84+
node-version: 18.x
85+
- name: lint
86+
uses: pre-commit/action@v3.0.0
87+
with:
88+
extra_args: markdownlint-cli2 --all-files

0 commit comments

Comments
 (0)