2022-12-13 17:43:26 +00:00
|
|
|
name: Plane Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
image: postgres:latest
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_DB: github_actions
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:latest
|
|
|
|
env:
|
|
|
|
REDIS_HOST: localhost
|
|
|
|
REDIS_PORT: 6379
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
options: --health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Python 3.9
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.9
|
|
|
|
- name: psycopg2 prerequisites
|
|
|
|
run: sudo apt-get install libpq-dev
|
|
|
|
- name: Install dependencies
|
2022-12-13 18:30:07 +00:00
|
|
|
working-directory: ./apiserver
|
2022-12-13 17:43:26 +00:00
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
2022-12-13 18:30:07 +00:00
|
|
|
pip install -r requirements/test.txt
|
2022-12-13 17:43:26 +00:00
|
|
|
- name: Run Tests
|
2022-12-13 18:30:07 +00:00
|
|
|
working-directory: ./apiserver
|
2022-12-13 18:33:19 +00:00
|
|
|
env:
|
2022-12-13 18:37:59 +00:00
|
|
|
SECRET_KEY: ${{ secrets.SECRET_KEY }}
|
2022-12-13 17:43:26 +00:00
|
|
|
run: coverage run --source='.' manage.py test --settings=plane.settings.test
|