Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
rmcryptpad-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
- name: Install backend dependencies
working-directory: rmcryptpad
run: poetry install --no-interaction
- name: Run backend tests
working-directory: rmcryptpad
run: poetry run pytest -v

rmcryptpad-ui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v5
with:
node-version: "20"
cache: pnpm
cache-dependency-path: rmcryptpad/ui/pnpm-lock.yaml
- name: Install UI dependencies
working-directory: rmcryptpad/ui
run: pnpm install --frozen-lockfile
- name: Run UI tests
working-directory: rmcryptpad/ui
run: pnpm test -- --run

cryptpad-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run image smoke test
run: sh tests/test_cryptpad_image.sh

standalone-compose-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Run standalone compose smoke test
run: bash tests/test_compose_smoke.sh
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
SHELL := /bin/bash

.DEFAULT_GOAL := test

POETRY_HELPER_DIR ?= /tmp/cryptpad-poetry-verify
POETRY_VENV_ROOT ?= /tmp/cryptpad-poetry-venvs
POETRY_BIN := $(POETRY_HELPER_DIR)/bin/poetry

.PHONY: up down test test-backend test-ui test-image test-compose poetry-helper

poetry-helper:
@if [ ! -x "$(POETRY_BIN)" ]; then \
python3 -m venv "$(POETRY_HELPER_DIR)" && \
"$(POETRY_HELPER_DIR)/bin/pip" install --quiet poetry; \
fi

up:
docker compose up -d --build

down:
docker compose down -v

test:
@$(MAKE) --no-print-directory test-backend
@echo "== backend ok =="
@$(MAKE) --no-print-directory test-ui
@echo "== ui ok =="
@$(MAKE) --no-print-directory test-image
@echo "== image ok =="
@$(MAKE) --no-print-directory test-compose
@echo "== compose ok =="
@echo "== all tests passed =="

test-backend: poetry-helper
@cd rmcryptpad && \
unset VIRTUAL_ENV CONDA_PREFIX PYTHONHOME PYTHONPATH && \
export POETRY_VIRTUALENVS_PATH="$(POETRY_VENV_ROOT)"; \
export PATH="$(POETRY_HELPER_DIR)/bin:$$PATH"; \
poetry install --no-interaction && \
VENV_PATH="$$(poetry env info -p)" && \
"$$VENV_PATH/bin/pytest" -v

test-ui:
cd rmcryptpad/ui && pnpm install --frozen-lockfile && pnpm test -- --run

test-image:
sh tests/test_cryptpad_image.sh

test-compose:
bash tests/test_compose_smoke.sh
Loading