Skip to content

Commit 6c2c052

Browse files
Add github actions workflow.
1 parent 640073d commit 6c2c052

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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: access-parsers
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
formatting:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Code formatting
21+
uses: psf/black@stable
22+
with:
23+
options: "--check --verbose --diff"
24+
src: "./src ./tests"
25+
26+
build:
27+
needs: formatting
28+
runs-on: ubuntu-latest
29+
strategy:
30+
matrix:
31+
python-version: ['3.10', '3.11', '3.12']
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v3
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install '.[devel,test]'
43+
- name: Lint with flake8
44+
run: |
45+
# stop the build if there are Python syntax errors or undefined names
46+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
47+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
48+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
49+
- name: Test with pytest
50+
run: |
51+
python -m pytest
52+
- name: Upload coverage reports to Codecov with GitHub Action
53+
uses: codecov/codecov-action@v5
54+
with:
55+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)