Skip to content

Commit fb02a5c

Browse files
committed
feat: split static check and test pipelines + add ty static checker in check cd/cd
1 parent 365183e commit fb02a5c

File tree

3 files changed

+91
-56
lines changed

3 files changed

+91
-56
lines changed

.github/workflows/check.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
- 'feature/**'
9+
pull_request:
10+
branches:
11+
- master
12+
- release
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
19+
check:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
25+
- name: Dump GitHub context
26+
env:
27+
GITHUB_CONTEXT: ${{ toJson(github) }}
28+
run: echo "$GITHUB_CONTEXT"
29+
30+
- uses: actions/checkout@v4
31+
32+
- name: 🐍 Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.12"
36+
37+
- uses: Gr1N/setup-poetry@v8
38+
with:
39+
poetry-version: "2.1.3"
40+
41+
- name: 🚀 Install Dependencies
42+
run: |
43+
# libgl1 library install needed for opencv-python to be imported to work
44+
sudo apt-get update -y
45+
sudo apt-get install libgl1 -y
46+
python -m pip install --upgrade pip
47+
mkdir .venv
48+
poetry config virtualenvs.create true
49+
poetry install --without docs,dev,test
50+
source .venv/bin/activate
51+
which python
52+
53+
- name: ✅ Check Code Quality - Pylint
54+
run: |
55+
make check-pylint
56+
continue-on-error: false
57+
58+
- name: ✅ Check Code Quality - Ruff
59+
run: |
60+
make check-ruff
61+
continue-on-error: false
62+
63+
- name: ✅ Check Code Quality - Mypy
64+
run: |
65+
make check-mypy
66+
continue-on-error: false
67+
68+
- name: ✅ Check Code Quality - Ty
69+
run: |
70+
make check-ty
71+
continue-on-error: false
72+
73+
- name: ✅ Check Code Quality - Black
74+
run: |
75+
make check-black
76+
continue-on-error: false
77+

.github/workflows/test.yaml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,62 +15,6 @@ permissions:
1515
contents: read
1616

1717
jobs:
18-
lint:
19-
20-
runs-on: ubuntu-latest
21-
22-
steps:
23-
24-
- name: Dump GitHub context
25-
env:
26-
GITHUB_CONTEXT: ${{ toJson(github) }}
27-
run: echo "$GITHUB_CONTEXT"
28-
29-
- uses: actions/checkout@v4
30-
31-
- name: 🐍 Set up Python
32-
uses: actions/setup-python@v5
33-
with:
34-
python-version: "3.12"
35-
36-
- uses: Gr1N/setup-poetry@v8
37-
with:
38-
poetry-version: "2.1.3"
39-
40-
- name: 🚀 Install Dependencies
41-
run: |
42-
# libgl1 library install needed for opencv-python to be imported to work
43-
sudo apt-get update -y
44-
sudo apt-get install libgl1 -y
45-
python -m pip install --upgrade pip
46-
poetry config virtualenvs.create false
47-
poetry install --with check
48-
49-
- name: ✅ Check Code Quality - Pylint
50-
run: |
51-
make check-pylint
52-
continue-on-error: false
53-
54-
- name: ✅ Check Code Quality - Ruff
55-
run: |
56-
make check-ruff
57-
continue-on-error: false
58-
59-
- name: ✅ Check Code Quality - Mypy
60-
run: |
61-
make check-mypy
62-
continue-on-error: false
63-
64-
- name: ✅ Check Code Quality - Ty
65-
run: |
66-
make check-ty
67-
continue-on-error: false
68-
69-
- name: ✅ Check Code Quality - Black
70-
run: |
71-
make check-black
72-
continue-on-error: false
73-
7418

7519
test:
7620

docs/about/contributing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ This will run all the code quality checks and the tests. Tools used for Otary de
9191

9292
For a fine-grained control on checks and tests, you can take a look at the `Makefile` at the root of the repository.
9393

94+
## Contribute to CI/CD pipelines
95+
96+
If you want to contribute to CI/CD pipelines you are welcome!
97+
98+
I encourage you to try and adopt the tool named [`act`](https://github.com/nektos/act) for this purpose in order to iterate more quickly by executing GitHub Actions locally.
99+
100+
You can select the jobs you want to run by executing the following command for example:
101+
102+
```bash
103+
act -j check
104+
```
105+
106+
This way you would be executing the check job only locally.
107+
94108
### Interactive Jupyter Notebook development
95109

96110
Since Otary is a image and geometry processing library, **having a visual interface to play with is a must**.

0 commit comments

Comments
 (0)