Skip to content

Commit 01bec5b

Browse files
Improve CI testing (#29)
* Improve CI testing * Run pytest on source files * Don't run on pypy
1 parent f3621c7 commit 01bec5b

3 files changed

Lines changed: 39 additions & 14 deletions

File tree

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
format:
7+
runs-on: ${{ matrix.os }}-latest
8+
strategy:
9+
matrix:
10+
os: [ubuntu]
11+
python-version: ["3.10"]
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
20+
- uses: actions/cache@v3
21+
with:
22+
path: ~/.cache/pip
23+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
24+
restore-keys: |
25+
${{ runner.os }}-pip-
26+
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install .[lint]
31+
32+
- name: Lint
33+
run: pre-commit run --all-files --show-diff-on-failure --color always

.github/workflows/test.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ jobs:
77
runs-on: ${{ matrix.os }}-latest
88
strategy:
99
matrix:
10-
os: [ubuntu]
11-
python-version: ["3.10"]
10+
os: [ubuntu, macos, windows]
11+
python-version: ["3.8", "3.9", "3.10", "3.11-dev"]
1212

1313
steps:
1414
- uses: actions/checkout@v3
@@ -27,12 +27,8 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip
30-
pip install flit
31-
flit install
32-
33-
- name: Lint
34-
run: pre-commit run --all-files --show-diff-on-failure --color always
30+
pip install .[test]
3531
3632
- name: Test
3733
run: |
38-
pytest
34+
pytest --doctest-modules --durations=10

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,8 @@ dependencies = [
1919
]
2020

2121
[project.optional-dependencies]
22-
test = [
23-
"pytest",
24-
"black",
25-
"pre-commit",
26-
"flake8"
27-
]
22+
test = ["pytest"]
23+
lint = ["pre-commit"]
2824

2925
[project.scripts]
3026
yaml2ics = "yaml2ics:main"

0 commit comments

Comments
 (0)