Overhaul setup of Flask and Celery apps #496
Workflow file for this run
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
env: | |
RABBITMQ_DEFAULT_USER: tester | |
RABBITMQ_DEFAULT_PASS: testpass | |
POSTGRES_DB: pgdb | |
POSTGRES_USER: tester | |
POSTGRES_PASSWORD: testpass | |
CELERY_BROKER_URL: "amqp://tester:testpass@localhost:5672" | |
CELERY_RESULT_BACKEND: "redis://localhost:6379" | |
SQLALCHEMY_DATABASE_URI: "postgresql+psycopg2://tester:testpass@localhost:5432/pgdb" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure environment | |
run: | | |
git config --global user.name dl-registry | |
git config --global user.email [email protected] | |
- name: Install git-annex | |
shell: bash | |
run: | | |
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh) | |
sudo apt-get update -qq | |
sudo apt-get install eatmydata | |
sudo eatmydata apt-get install git-annex-standalone | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip install wheel | |
pip install mypy types-requests | |
pip install .[tests] | |
- name: Set up broker, result backend, and database services | |
run: docker compose -f docker-compose.testing.yml up -d --build | |
- name: Run tests with coverage | |
run: pytest --cov=. --cov-report=xml | |
- name: mypy check | |
run: mypy datalad_registry datalad_registry_client | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v3 |