Compare commits
No commits in common. "1f3594d5dbb7b0a058912f87e17b52845f5aaa1b" and "bf43603d6509dad4bbded42ed6f03a675489dbb9" have entirely different histories.
1f3594d5db
...
bf43603d65
6 changed files with 93 additions and 6 deletions
|
|
@ -1,6 +0,0 @@
|
||||||
on: [push]
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: docker
|
|
||||||
steps:
|
|
||||||
- run: echo All Good
|
|
||||||
29
.gitlab-ci.yml
Normal file
29
.gitlab-ci.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- lint
|
||||||
|
- release
|
||||||
|
|
||||||
|
variables:
|
||||||
|
UV_CACHE_DIR: "$CI_PROJECT_DIR/.cache/uv"
|
||||||
|
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_COMMIT_REF_SLUG"
|
||||||
|
paths:
|
||||||
|
- .cache/pip
|
||||||
|
- .cache/uv
|
||||||
|
- node_modules/
|
||||||
|
- .venv/
|
||||||
|
|
||||||
|
include:
|
||||||
|
- local: '/gitlab-ci/build.yml'
|
||||||
|
- local: '/gitlab-ci/test.yml'
|
||||||
|
- local: '/gitlab-ci/lint.yml'
|
||||||
|
- local: '/gitlab-ci/release.yml'
|
||||||
7
gitlab-ci/build.yml
Normal file
7
gitlab-ci/build.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
static:
|
||||||
|
stage: build
|
||||||
|
image: node:lts
|
||||||
|
before_script:
|
||||||
|
- npm install
|
||||||
|
script:
|
||||||
|
- npm run build
|
||||||
25
gitlab-ci/lint.yml
Normal file
25
gitlab-ci/lint.yml
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
python-linting:
|
||||||
|
stage: lint
|
||||||
|
image: python:3.11
|
||||||
|
before_script:
|
||||||
|
- pip install uv
|
||||||
|
- uv sync --extra testing --extra ci
|
||||||
|
script:
|
||||||
|
- ./.venv/bin/ruff check src/
|
||||||
|
- ./.venv/bin/ruff format --check src/
|
||||||
|
only:
|
||||||
|
refs:
|
||||||
|
- main
|
||||||
|
- merge_requests
|
||||||
|
|
||||||
|
javascript-linting:
|
||||||
|
stage: lint
|
||||||
|
image: node:lts
|
||||||
|
before_script:
|
||||||
|
- npm install
|
||||||
|
script:
|
||||||
|
- npm run lint
|
||||||
|
only:
|
||||||
|
refs:
|
||||||
|
- main
|
||||||
|
- merge_requests
|
||||||
12
gitlab-ci/release.yml
Normal file
12
gitlab-ci/release.yml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_TAG
|
||||||
|
script:
|
||||||
|
- echo 'running release job'
|
||||||
|
release:
|
||||||
|
name: 'Release $CI_COMMIT_TAG'
|
||||||
|
description: './CHANGELOG.md'
|
||||||
|
tag_name: '$CI_COMMIT_TAG'
|
||||||
|
ref: '$CI_COMMIT_TAG'
|
||||||
20
gitlab-ci/test.yml
Normal file
20
gitlab-ci/test.yml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
python-tests:
|
||||||
|
stage: test
|
||||||
|
coverage: '/TOTAL\s+\d+\s+\d+\s+(\d+%)/'
|
||||||
|
services:
|
||||||
|
- postgres:15
|
||||||
|
- memcached:1.5.22
|
||||||
|
image: python:3.11
|
||||||
|
before_script:
|
||||||
|
- pip install uv
|
||||||
|
- uv sync --extra testing --extra ci
|
||||||
|
script:
|
||||||
|
- ./.venv/bin/coverage run ./src/manage.py test newsreader
|
||||||
|
|
||||||
|
javascript-tests:
|
||||||
|
stage: test
|
||||||
|
image: node:lts
|
||||||
|
before_script:
|
||||||
|
- npm install
|
||||||
|
script:
|
||||||
|
- npm test
|
||||||
Loading…
Add table
Add a link
Reference in a new issue