newsreader/.gitlab-ci.yml

70 lines
1.4 KiB
YAML

stages:
- build
- test
- lint
javascript build:
image: node:12
stage: build
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- node_modules/
before_script:
- npm install
script:
- npx gulp
python tests:
services:
- postgres:11
image: python:3.7.4-slim-stretch
stage: test
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
DJANGO_SETTINGS_MODULE: "newsreader.conf.gitlab"
POSTGRES_DB: newsreader
POSTGRES_USER: newsreader
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cache/pip
- env/
before_script:
- python3 -m venv env
- source env/bin/activate
- pip install -r requirements/gitlab.txt
script:
- python src/manage.py test newsreader
javascript linting:
image: node:12
stage: lint
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- node_modules/
before_script:
- npm install
script:
- npm run lint
python linting:
image: python:3.7.4-slim-stretch
stage: lint
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
DJANGO_SETTINGS_MODULE: "newsreader.conf.gitlab"
cache:
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .cache/pip
- env/
before_script:
- python3 -m venv env
- source env/bin/activate
- pip install -r requirements/gitlab.txt
script:
- isort -rc src/ --check-only
- black -l 90 --check src/
- autoflake -rc src/