Update requirements.txt #40
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 Pipeline | ||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| jobs: | ||
| lint-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| 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 | ||
| - name: Lint with flake8 | ||
| run: flake8 src/ | ||
| - name: Run pytest | ||
| run: pytest --maxfail=1 --disable-warnings -q | ||
| dvc-pipeline: | ||
| runs-on: ubuntu-latest | ||
| needs: lint-and-test | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.9' | ||
| - name: Install DVC | ||
| run: pip install dvc[s3] | ||
| - name: DVC repro | ||
| run: dvc repro --force | ||
| docker-build: | ||
| runs-on: ubuntu-latest | ||
| needs: dvc-pipeline | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: Build Docker image | ||
| run: | | ||
| docker build -t algoquant-backtester:latest . | ||
| - name: Run container smoke test | ||
| run: | | ||
| docker run --rm algoquant-backtester:latest python -c "import src.serve.app" | ||
| git add .github/workflows/ci.yml | ||
| git commit -m "Add CI workflow: lint, test, DVC pipeline, Docker build smoke test" | ||
| git push | ||