Skip to content

Update eslint.yml

Update eslint.yml #192

Workflow file for this run

name: Python CI/CD Workflow
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: ['3.9-slim', '3.10-slim', '3.11-slim']
ubuntu-version: ['ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-latest']
runs-on: ${{ matrix.ubuntu-version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install coverage flake8
- name: Set Environment Variables
run: echo "DJANGO_SETTINGS_MODULE=dropship_project.settings" >> $GITHUB_ENV
- name: Run Tests
run: python manage.py test
- name: Generate Coverage Report
run: |
coverage run --source='.' manage.py test
coverage report
coverage xml -o coverage.xml
if: always()
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
fail_ci_if_error: false
verbose: true
if: always()
- name: Lint Code with Flake8
run: flake8 .
- name: Cleanup Pip Cache
run: python -m pip cache purge
if: always()