Add Docker support for containerized deployments #90
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: Test and Lint | |
on: | |
pull_request: | |
branches: [ main ] | |
push: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
meilisearch: | |
image: getmeili/meilisearch:v1.6 | |
ports: | |
- 7700:7700 | |
env: | |
MEILI_MASTER_KEY: test_master_key | |
MEILI_ENV: development | |
options: >- | |
--health-cmd "curl -f http://localhost:7700/health || exit 1" | |
--health-interval 30s | |
--health-timeout 10s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install -e . | |
- name: Format code with black | |
run: | | |
black src/ | |
black tests/ | |
- name: Wait for Meilisearch to be ready | |
run: | | |
timeout 60 bash -c 'until curl -f http://localhost:7700/health; do sleep 2; done' | |
- name: Run tests | |
env: | |
MEILI_HTTP_ADDR: http://localhost:7700 | |
MEILI_MASTER_KEY: test_master_key | |
run: | | |
pytest tests/ -v |