mirror of
https://github.com/Sosokker/ku-polls.git
synced 2025-12-18 13:04:05 +01:00
Add github actions - Linting and Unit Tests
Add GitHub actions more testing and linting
This commit is contained in:
commit
4853f8d4fa
38
.github/workflows/django.yml
vendored
Normal file
38
.github/workflows/django.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: Unit Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 4
|
||||
matrix:
|
||||
python-version: [3.11.4]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Create and Activate Python Virtual Environment
|
||||
run: |
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
|
||||
- name: Run Tests
|
||||
run: |
|
||||
python manage.py test
|
||||
36
.github/workflows/flake8-lint.yml
vendored
Normal file
36
.github/workflows/flake8-lint.yml
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
||||
|
||||
name: Lint with Flake8
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python 3.11.4
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: "3.11.4"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install flake8
|
||||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
|
||||
- name: Lint with flake8
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
@ -1,4 +1,5 @@
|
||||
## KU Polls: Online Survey Questions
|
||||
[](https://github.com/Sosokker/ku-polls/actions/workflows/django.yml)
|
||||
|
||||
An application to conduct online polls and surveys based
|
||||
on the [Django Tutorial project](https://docs.djangoproject.com/en/4.2/intro/tutorial01/), with additional features.
|
||||
@ -67,4 +68,4 @@ All project documents are in the [Project Wiki](https://github.com/Sosokker/ku-p
|
||||
- [Vision Statement](https://github.com/Sosokker/ku-polls/wiki/Vision-Statement)
|
||||
- [Requirements](https://github.com/Sosokker/ku-polls/wiki/Requirements)
|
||||
|
||||
[django-tutorial](https://docs.djangoproject.com/en/4.2/intro/tutorial01/)
|
||||
[django-tutorial](https://docs.djangoproject.com/en/4.2/intro/tutorial01/)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user