Skip to content

Commit d99c300

Browse files
authored
Create ci.yml
1 parent 5a87858 commit d99c300

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: CI
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
paths-ignore:
10+
- "**/*.md"
11+
- "CODEOWNERS"
12+
- "Makefile"
13+
pull_request:
14+
branches: [ "main" ]
15+
paths-ignore:
16+
- "**/*.md"
17+
- "CODEOWNERS"
18+
- "Makefile"
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
build:
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Python 3.10
31+
uses: actions/setup-python@v3
32+
with:
33+
python-version: "3.10"
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install flake8 pytest
38+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
39+
- name: Lint with flake8
40+
run: |
41+
# stop the build if there are Python syntax errors or undefined names
42+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
43+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
44+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
45+
- name: Test with pytest
46+
run: |
47+
pytest

0 commit comments

Comments
 (0)