Update packages #67
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: tests | |
on: push | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:11 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
# 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@v2 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/pip | |
~/.local/bin | |
~/.local/lib | |
key: ${{ runner.os }}-pip-${{ hashFiles('backend/requirements/base.txt', 'backend/requirements.dev.txt') }} | |
- name: Install stockfish | |
run: | | |
sudo apt-get -y install stockfish | |
- name: Install requirements | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r backend/requirements/base.txt | |
pip install -r backend/requirements/dev.txt | |
shell: bash | |
- name: Lint with Black | |
run: | | |
black backend --check --line-length 80 | |
- name: Test with pytest | |
run: | | |
pytest -v | |
working-directory: backend | |
env: | |
PYTHONUNBUFFERED: 1 | |
DATABASE_URL: postgresql://postgres:postgres@localhost/postgres | |
frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Test using Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: "14" | |
- name: Install dependencies | |
run: | | |
cd frontend/ | |
npm install | |
env: | |
CI: true | |
- name: Prettify code | |
run: | | |
cd frontend/ | |
npm run lint | |
- name: Test | |
run: | | |
cd frontend/ | |
npm test --ci --coverage --maxWorkers=2 | |
env: | |
CI: true |