Skip to content

Release: Docs - add to README and reformat, tweak docker-compose.yml #574

Release: Docs - add to README and reformat, tweak docker-compose.yml

Release: Docs - add to README and reformat, tweak docker-compose.yml #574

Workflow file for this run

name: Test Python & JavaScript
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DATABASE: test
POSTGRES_PASSWORD: test
POSTGRES_USER: test
POSTGRES_HOST_AUTH_METHOD: trust
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: check out code
uses: actions/checkout@v3
# Python dependencies
- name: setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: install Poetry
uses: snok/install-poetry@v1
- name: cache Poetry virtualenv
uses: actions/cache@v3
id: poetry-cache
with:
path: ~/.virtualenvs/
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}
- name: set poetry config path
run: poetry config virtualenvs.path ~/.virtualenvs
- name: install python dependencies
run: poetry install
- name: lint with flake8 and black
run: poetry run inv lint
# node dependencies
- name: setup Node 12
uses: actions/setup-node@v1
with:
node-version: '12'
- name: cache node_modules
uses: actions/cache@v3
id: node-cache
with:
path: ./node_modules
key: node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-${{ hashFiles('**/package-lock.json') }}
- name: install node packages
run: npm install && npm run build
- name: pytest
run: poetry run inv test --no-docker-db
env:
DATABASE_URL: postgresql://test:test@localhost/test