Compare commits
9 commits
main
...
forgejo-ac
| Author | SHA1 | Date | |
|---|---|---|---|
| cefc2ca8a7 | |||
| 649d52755e | |||
| 8c70a32c7b | |||
| 34d48dea39 | |||
| 9972f38651 | |||
| f9a4aff0b4 | |||
| b34737ef20 | |||
| 1f3594d5db | |||
| 11b553784c |
7 changed files with 63 additions and 94 deletions
62
.forgejo/workflows/tests.yml
Normal file
62
.forgejo/workflows/tests.yml
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
on: [ push ]
|
||||||
|
|
||||||
|
env:
|
||||||
|
POSTGRES_HOST: "postgres"
|
||||||
|
POSTGRES_DB: "newsreader"
|
||||||
|
POSTGRES_USER: "newsreader"
|
||||||
|
POSTGRES_PASSWORD: "newsreader"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: docker
|
||||||
|
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:15
|
||||||
|
env:
|
||||||
|
POSTGRES_HOST: "${{ env.POSTGRES_HOST }}"
|
||||||
|
POSTGRES_DB: "${{ env.POSTGRES_NAME }}"
|
||||||
|
POSTGRES_NAME: "${{ env.POSTGRES_NAME }}"
|
||||||
|
POSTGRES_USER: "${{ env.POSTGRES_USER }}"
|
||||||
|
POSTGRES_PASSWORD: "${{ env.POSTGRES_PASSWORD }}"
|
||||||
|
memcached:
|
||||||
|
image: memcached:1.5.22
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: apt-get --yes update && apt-get --yes install nodejs git
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 'lts/*'
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: "${{ GITHUB_WORKSPACE }}/.cache/uv"
|
||||||
|
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-uv-
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: "${{ GITHUB_WORKSPACE }}/.cache/pip"
|
||||||
|
key: ${{ runner.os }}-pip-
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
|
- run: pip install uv
|
||||||
|
env:
|
||||||
|
PIP_CACHE_DIR: "${{ GITHUB_WORKSPACE }}/.cache/pip"
|
||||||
|
- run: uv sync --extra testing --extra ci
|
||||||
|
env:
|
||||||
|
UV_CHACHE_DIR: "${{ GITHUB_WORKSPACE }}/.cache/uv"
|
||||||
|
|
||||||
|
- run: ./.venv/bin/coverage run ./src/manage.py test newsreader
|
||||||
|
env:
|
||||||
|
DJANGO_SETTINGS_MODULE: "newsreader.conf.ci"
|
||||||
|
POSTGRES_HOST: "${{ env.POSTGRES_HOST }}"
|
||||||
|
POSTGRES_DB: "${{ env.POSTGRES_NAME }}"
|
||||||
|
POSTGRES_NAME: "${{ env.POSTGRES_NAME }}"
|
||||||
|
POSTGRES_USER: "${{ env.POSTGRES_USER }}"
|
||||||
|
POSTGRES_PASSWORD: "${{ env.POSTGRES_PASSWORD }}"
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
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'
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
static:
|
|
||||||
stage: build
|
|
||||||
image: node:lts
|
|
||||||
before_script:
|
|
||||||
- npm install
|
|
||||||
script:
|
|
||||||
- npm run build
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
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
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
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'
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
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
|
|
||||||
|
|
@ -33,7 +33,7 @@ CACHES = {
|
||||||
|
|
||||||
# Project settings
|
# Project settings
|
||||||
VERSION = get_current_version()
|
VERSION = get_current_version()
|
||||||
ENVIRONMENT = "gitlab"
|
ENVIRONMENT = "ci"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Optionally use sentry integration
|
# Optionally use sentry integration
|
||||||
Loading…
Add table
Add a link
Reference in a new issue