Skip to content

Commit

Permalink
.github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
vanschelven committed Sep 5, 2024
1 parent 02b2e50 commit 47ae722
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Flake8

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"] # below 3.12 to avoid false positives inside f-strings

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Flake8
run: |
python -m pip install --upgrade flake8
- name: Run Flake8
run: |
# We ignore 2 classes of whitespace errors (which are useful in the local context,
# but not worth breaking the build).
# https://github.com/PyCQA/flake8/issues/515 shows a dead end of doing this "properly"
# so we just specify it on the command line
flake8 --extend-ignore=E127,E741,E501 `git ls-files | grep py$`
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Create wheel and install it
run: |
python -m pip install --upgrade pip
pip install build
python -m build .
pip install django
pip install dist/*.whl
- name: Run Tests
run: |
cd example_django_project
python manage.py test snappea

0 comments on commit 47ae722

Please sign in to comment.