use docker compose #326
This file contains 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 | |
on: | |
push: | |
branches: '*' | |
pull_request: | |
branches: '*' | |
# schedule: | |
# - cron: '5 5 * * *' | |
#jobs: | |
# build_python: | |
# | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# python-version: [3.8] | |
# | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - name: Set up Python ${{ matrix.python-version }} | |
# uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# | |
# - name: Install dependencies | |
# run: | | |
# pip install -r requirements.txt | |
# pip install mypy pytest-flake8 | |
# | |
# - name: Check Python version | |
# run: python -V | |
# | |
# - name: Start MongoDB | |
# uses: supercharge/[email protected] | |
# with: | |
# mongodb-version: 4.0 | |
# | |
# - name: Test with pytest | |
# run: | | |
# pytest -sv --flake8 | |
# mypy --ignore-missing-imports PyDigger/ | |
jobs: | |
in_docker_compose: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build the stack | |
run: docker compose up -d | |
- name: Test | |
run: docker exec pydiggercom_web_1 pytest -svv | |
- name: Stop the docker compose | |
run: docker compose stop | |
- name: Build the stack again now with example | |
run: docker compose -f docker-compose.yml -f docker-compose.override.yml.example up -d | |
# - name: Run linting | |
# run: docker exec pydiggercom_web_1 flake8 --count --show-source --statistics # need to fix linting issue | |
- name: Run the test again | |
run: docker exec pydiggercom_web_1 pytest -svv # --flake8 --mypy | |