Skip to content

Fix functions component in metadata #546

Fix functions component in metadata

Fix functions component in metadata #546

Workflow file for this run

name: pytest
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
db-backend: [mysql, postgres]
python-version: ['3.9', '3.11']
services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres_password
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
sudo apt update
sudo apt install -y libpq-dev postgresql postgresql-client
python -m pip install --upgrade pip
- name: Install Daiquiri
run: |
pip install -e .
pip install psycopg2-binary
pip install mysqlclient
pip install coveralls
- name: Prepare testing app
run: |
cp testing/config/settings/${{ matrix.db-backend }}.py testing/config/settings/local.py
mkdir testing/log testing/download
- name: Prepare MySQL database
run: |
sudo systemctl start mysql.service
mysql --user=root --password=root < testing/sql/mysql/test.sql
cat ../daiquiri/testing/sql/mysql/data/* | mysql --user=root --password=root
- name: Prepare PostgreSQL database
run: |
psql postgresql://postgres:postgres_password@localhost:5432 -f testing/sql/postgres/test.sql
cat ../daiquiri/testing/sql/postgres/data/* | psql postgresql://postgres:postgres_password@localhost:5432/test_daiquiri_data
psql postgresql://postgres:postgres_password@localhost:5432/test_daiquiri_data -c 'VACUUM ANALYSE;'
- name: Run tests
run: |
pytest --reuse-db --cov=daiquiri
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: '${{ matrix.db-backend }}: ${{ matrix.python-version }}'
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Run Coveralls finish
run: |
pip install coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}