commit 99fd94580f95dcbfb77b73e2de846f76a5709ef9
Author: Sonny <sonnyba871@gmail.com>
Date: Sat Feb 15 21:45:16 2020 +0100
Use postgres password
As of https://gitlab.com/gitlab-com/support-forum/issues/5199
85 lines
1.7 KiB
YAML
85 lines
1.7 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_HOST: "$POSTGRES_HOST"
|
|
POSTGRES_DB: "$POSTGRES_NAME"
|
|
POSTGRES_NAME: "$POSTGRES_NAME"
|
|
POSTGRES_USER: "$POSTGRES_USER"
|
|
POSTGRES_PASSWORD: "$POSTGRES_PASSWORD"
|
|
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 tests:
|
|
image: node:12
|
|
stage: test
|
|
cache:
|
|
key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
|
|
paths:
|
|
- node_modules/
|
|
before_script:
|
|
- npm install
|
|
script:
|
|
- npm test
|
|
|
|
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/
|