Fix requirements for Streamlit Cloud deployment #28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline | |
| 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 black flake8 | |
| - name: Run linting | |
| run: | | |
| black --check . | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| - name: Run tests | |
| run: | | |
| export PYTHONPATH=$PYTHONPATH:$(pwd) | |
| pytest tests/ --cov=src --cov-report=xml | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage.xml | |
| build: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t cisco-network-simulator:latest . | |
| - name: Test Docker image | |
| run: | | |
| docker run -d -p 8501:8501 cisco-network-simulator:latest | |
| sleep 10 | |
| curl -f http://localhost:8501 || exit 1 |