Use photos/media_items
prefix
#598
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: Test | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- '[0-2].[0-9]+.[0-9]+*' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
edgedb: | |
image: edgedb/edgedb:4.4 | |
env: | |
EDGEDB_SERVER_USER: edgedb | |
EDGEDB_SERVER_PASSWORD: root | |
EDGEDB_SERVER_TLS_KEY: ${{ secrets.EDGEDB_SERVER_TLS_KEY }} | |
EDGEDB_SERVER_TLS_CERT: ${{ secrets.EDGEDB_SERVER_TLS_CERT }} | |
ports: | |
- 5656:5656 | |
options: >- | |
--health-cmd="echo "${EDGEDB_SERVER_PASSWORD}" | edgedb query -H localhost --password-from-stdin --tls-security=insecure 'SELECT 1;'" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup minio | |
env: | |
MINIO_ROOT_USER: ${{ secrets.S3_ACCESS_KEY_ID }} | |
MINIO_ROOT_PASSWORD: ${{ secrets.S3_SECRET_ACCESS_KEY }} | |
run: | | |
docker run -d -p 9000:9000 --name minio \ | |
-e "MINIO_ACCESS_KEY=$MINIO_ROOT_USER" \ | |
-e "MINIO_SECRET_KEY=$MINIO_ROOT_PASSWORD" \ | |
-v /tmp/data:/data \ | |
-v /tmp/config:/root/.minio \ | |
minio/minio server /data | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@master | |
with: | |
python-version: "3.12" | |
- name: Cache pip dependencies | |
uses: actions/cache@master | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/**.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel | |
pip install \ | |
-r requirements/base.txt \ | |
-r requirements/test.txt | |
- name: Run Tests | |
env: | |
PYTHONPATH: . | |
AUTH__SECRET_KEY: github_actions | |
DATABASE__DSN: "edgedb://edgedb:root@localhost:5656/edgedb" | |
DATABASE__EDGEDB_TLS_CA_FILE: "./certs/edbtlscert.dev.pem" | |
STORAGE__TYPE: "filesystem" | |
STORAGE__FS_LOCATION: "./data" | |
STORAGE__S3_LOCATION: "http://localhost:9000" | |
STORAGE__S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} | |
STORAGE__S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} | |
STORAGE__S3_REGION_NAME: "us-east-1" | |
WORKER__BROKER_DSN: "redis://localhost:6379" | |
run: | | |
pytest --cov --cov-report=xml | |
- name: Send coverage report | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./coverage.xml | |
fail_ci_if_error: true | |
verbose: true |