Skip to content

Updated repquirements to add plotly for the dashboard in app.py #4

Updated repquirements to add plotly for the dashboard in app.py

Updated repquirements to add plotly for the dashboard in app.py #4

Workflow file for this run

# .github/workflows/ci.yml
name: GuardianSensor CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Run tests with pytest
run: |
pytest tests/ -v --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: true
- name: Run security scan
run: |
pip install bandit safety
bandit -r . -f json -o bandit-report.json
safety check
lint:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install linting tools
run: |
pip install black flake8 isort mypy
- name: Check code formatting with black
run: |
black --check .
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
- name: Check imports with isort
run: |
isort --check-only .
- name: Type checking with mypy
run: |
mypy api/ processing/ risk/ utils/ --ignore-missing-imports
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: |
docker build -t guardiansensor:latest .
- name: Run Docker container test
run: |
docker run -d --name guardiansensor-test -p 8000:8000 guardiansensor:latest
sleep 10
curl -f http://localhost:8000/health || exit 1
docker stop guardiansensor-test
docker rm guardiansensor-test