v0.0.9: Allow rds_client.py to sync to a local sqlite3 file (#66) #248
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: Continuous integration tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
max-parallel: 4 | |
matrix: | |
# TODO: support older pythons | |
# python-version: [3.8, 3.9, 3.10, 3.11] | |
python-version: [3.11] | |
services: | |
postgres: | |
# image should match heroku and/or docker-compose.yaml | |
image: postgres:13.1 | |
env: | |
POSTGRES_USER: postgres | |
# needs a password | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: github-actions | |
ports: | |
- 5432:5432 # exposing 5432 port for application to use | |
# needed because the postgres container does not provide a healthcheck | |
options: >- | |
--health-cmd pg_isready --health-interval 10s | |
--health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v4 | |
# Gradle plugin needs Java 11, so we can't use Java 8. | |
# - name: Set up Java | |
# uses: actions/setup-java@v1.4.3 | |
# with: | |
# java-version: 1.8 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
# see https://github.com/pre-commit/action/#using-this-action | |
- name: pre-commit checks | |
uses: pre-commit/action@v3.0.1 | |
env: | |
# it's okay for github to commit to main/master | |
SKIP: no-commit-to-branch | |
- name: Install dependencies | |
run: | | |
cd python | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
- name: Run tests | |
run: | | |
cd python | |
# For debugging, uncomment LOG_LEVEL=DEBUG: | |
# PYTHONPATH=. LOG_LEVEL=DEBUG python -m unittest discover -s tests | |
PYTHONPATH=. python -m unittest discover -s tests | |
# Install library for Django: | |
python -m pip install -e . | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_HOST: localhost | |
- name: Run Django tests | |
run: | | |
cd django | |
pip install -r requirements.txt | |
# python manage.py collectstatic --noinput | |
python manage.py test | |
env: | |
# Variables for unit tests | |
# must match postgres service above | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/default | |
SECRET_KEY: this-has-to-be-at-least-51-characters-and-6-unique-ones | |
- name: Run java tests | |
run: | | |
cd java/android | |
./gradlew check |