Replace GitLab CI with Gitea workflows
The GitLab deploy job has no replacement yet; deploy with bin/deploy by hand.
This commit is contained in:
3 files changed
+48
-43
No files matched your search
@@ -0,0 +1,12 @@
|
||||
name: "Lint: prek"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
prek:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: j178/prek-action@v1
|
||||
@@ -0,0 +1,36 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
build_frontend:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:20-alpine
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build frontend
|
||||
working-directory: frontend
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
container: nikolaik/python-nodejs:python3.11-nodejs20
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Run migrations
|
||||
run: uv run --locked manage.py migrate
|
||||
- name: Run Django checks
|
||||
run: uv run manage.py check
|
||||
- name: Run tests with coverage
|
||||
run: uv run pytest -v --cov bbs --cov-report term --cov-report xml:coverage.xml
|
||||
|
||||
- name: Upload coverage reports
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-report
|
||||
path: coverage.xml
|
||||
@@ -1,43 +0,0 @@
|
||||
variables:
|
||||
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
|
||||
|
||||
default:
|
||||
image: nikolaik/python-nodejs:python3.11-nodejs20
|
||||
cache:
|
||||
paths:
|
||||
- .cache/pip
|
||||
- .venv
|
||||
|
||||
django-checks:
|
||||
stage: build
|
||||
script:
|
||||
- uv run manage.py migrate
|
||||
- uv run manage.py check
|
||||
|
||||
tests:
|
||||
stage: test
|
||||
script:
|
||||
- uv run bin/test
|
||||
|
||||
lint:
|
||||
stage: test
|
||||
script:
|
||||
- uv run bin/pre-commit
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
before_script:
|
||||
# Install ssh if not already
|
||||
- 'command -v ssh-agent >/dev/null || ( apt-get update -y && apt-get install openssh-client -y )'
|
||||
- eval $(ssh-agent -s)
|
||||
# Make SSH key available
|
||||
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
||||
- mkdir -p ~/.ssh
|
||||
- chmod 700 ~/.ssh
|
||||
# Add known host keys
|
||||
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
|
||||
- chmod 644 ~/.ssh/known_hosts
|
||||
script:
|
||||
- ssh gitdeploy@dreamcast.neuf.no "$(< bin/deploy)"
|
||||
only:
|
||||
- main
|
||||
Reference in new issue
Block a user