Skip to content

Add CORS.

Add CORS. #64

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Run PEP8 linting and generate report
run: |
flake8 app --output-file=flake8report.txt
- name: Upload linting report
uses: actions/upload-artifact@v4
with:
name: linting-report
path: flake8report.txt
static_analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Run static analysis and generate report
run: |
mypy app --html-report mypy_report
- name: Upload static analysis report
uses: actions/upload-artifact@v4
with:
name: static-analysis-report
path: mypy_report
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cache/pip
.mypy_cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install development dependencies
run: pip install -r requirements-dev.txt
- name: Run pytest with coverage
run: |
pytest --cov=app --cov-report=xml:coverage.xml
- name: Upload test results and coverage report
uses: actions/upload-artifact@v4
with:
name: test-and-coverage-results
path: |
coverage.xml