Skip to content

Commit 90133c8

Browse files
authored
Merge pull request #38 from py-why/add-ci
Added a github action to automatically test code on PRs and commits
2 parents d537d73 + 0cb0b0d commit 90133c8

File tree

6 files changed

+1193
-2018
lines changed

6 files changed

+1193
-2018
lines changed

.github/workflows/python-package.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11"]
20+
poetry-version: [2.1.1]
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Python ${{ matrix.python-version }}
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
- name: Install Poetry ${{ matrix.poetry-version }}
29+
uses: abatilo/[email protected]
30+
with:
31+
poetry-version: ${{ matrix.poetry-version }}
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
python -m pip install flake8 pytest
36+
poetry run pip install --upgrade setuptools wheel
37+
poetry install
38+
- name: Lint with flake8
39+
run: |
40+
# stop the build if there are Python syntax errors or undefined names
41+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
44+
- name: Test with pytest
45+
run: |
46+
poetry run poe test

0 commit comments

Comments
 (0)