🔀 Merge pull request #46 from cnr-ibba/devel #114
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: docker-compose-workflow | |
on: | |
# Trigger the workflow on push or pull request, | |
# but only for the main branch | |
push: | |
branches: | |
- master | |
- devel | |
pull_request: | |
branches: | |
- master | |
- devel | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Make envfile | |
uses: SpicyPizza/create-envfile@v2 | |
with: | |
envkey_DEBUG: false | |
envkey_MONGODB_ROOT_USER: root | |
envkey_MONGODB_ROOT_PASS: password1 | |
envkey_MONGODB_SMARTER_USER: smarter | |
envkey_MONGODB_SMARTER_PASS: password2 | |
envkey_JWT_SECRET_KEY: test_secret_key | |
envkey_COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
file_name: .env | |
- name: install stuff | |
run: | | |
docker-compose pull | |
docker-compose build | |
docker-compose up -d mongo | |
docker-compose run --no-deps --rm uwsgi sh -c 'chgrp -R www-data .' | |
docker-compose ps | |
- name: Run test suite | |
run: docker-compose run --no-deps --rm uwsgi sh -c 'coverage run --source='.' -m pytest && flake8' | |
- name: Submitting coverage and code quality | |
run: | | |
docker-compose run --rm uwsgi coveralls | |
- name: Stop containers | |
if: always() | |
run: docker-compose down |