update ci/cd

This commit is contained in:
Tomas Dvorak
2026-04-27 11:23:56 +02:00
parent f532bdacad
commit 5657ed74e3
7 changed files with 93 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
.git
.github
.idea
.env
.env.*
analysis.md
cf-kv/
data/
docs/
e2e-test.db
excalidraw/
excalidraw-complete
excalidraw-complete.exe
excalidraw-full
excalidraw-libraries/
frontend/coverage/
frontend/dist/
frontend/node_modules/
frontend/playwright-report/
frontend/test-results/
*.db
*.db-journal
+32 -1
View File
@@ -13,6 +13,22 @@ env:
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: excalidraw
POSTGRES_PASSWORD: excalidraw
POSTGRES_DB: excalidraw_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U excalidraw -d excalidraw_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
TEST_DATABASE_URL: postgres://excalidraw:excalidraw@localhost:5432/excalidraw_test?sslmode=disable
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -22,7 +38,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.23' go-version-file: go.mod
- name: Run Go tests - name: Run Go tests
run: go test ./... -v -count=1 run: go test ./... -v -count=1
@@ -40,6 +56,9 @@ jobs:
- name: Build frontend - name: Build frontend
run: cd frontend && npm run build run: cd frontend && npm run build
- name: Typecheck frontend
run: cd frontend && npm run typecheck
- name: Run frontend tests - name: Run frontend tests
run: cd frontend && npm test -- --run run: cd frontend && npm test -- --run
@@ -57,6 +76,7 @@ jobs:
submodules: true submodules: true
- name: Log in to Container Registry - name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
@@ -81,7 +101,18 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build Docker image
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
file: ./excalidraw-full.Dockerfile
push: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
- name: Build and push Docker image - name: Build and push Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
+32 -4
View File
@@ -15,6 +15,22 @@ env:
jobs: jobs:
test: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: excalidraw
POSTGRES_PASSWORD: excalidraw
POSTGRES_DB: excalidraw_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U excalidraw -d excalidraw_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
TEST_DATABASE_URL: postgres://excalidraw:excalidraw@localhost:5432/excalidraw_test?sslmode=disable
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -24,7 +40,7 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@v5
with: with:
go-version: '1.23' go-version-file: go.mod
- name: Run Go tests - name: Run Go tests
run: go test ./... -v -count=1 run: go test ./... -v -count=1
@@ -42,7 +58,7 @@ jobs:
- name: Build frontend - name: Build frontend
run: cd frontend && npm run build run: cd frontend && npm run build
- name: Lint frontend - name: Typecheck frontend
run: cd frontend && npm run typecheck run: cd frontend && npm run typecheck
- name: Run frontend tests - name: Run frontend tests
@@ -62,6 +78,7 @@ jobs:
submodules: true submodules: true
- name: Log in to Container Registry - name: Log in to Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3 uses: docker/login-action@v3
with: with:
registry: ${{ env.REGISTRY }} registry: ${{ env.REGISTRY }}
@@ -86,12 +103,23 @@ jobs:
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build and push Docker image - name: Build Docker image
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
file: ./excalidraw-full.Dockerfile file: ./excalidraw-full.Dockerfile
push: ${{ github.event_name != 'pull_request' }} push: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
- name: Build and push Docker image
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
context: .
file: ./excalidraw-full.Dockerfile
push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.IMAGE_NAME }}:buildcache
+1 -1
View File
@@ -4,7 +4,7 @@
### Prerequisites ### Prerequisites
- Go 1.23+ - Go 1.26.2+
- Node.js 20+ - Node.js 20+
- npm or pnpm - npm or pnpm
- Docker (optional, for containerized builds) - Docker (optional, for containerized builds)
+2 -2
View File
@@ -41,7 +41,7 @@ The application will be available at `http://localhost:3002`.
## Requirements ## Requirements
- Go 1.25+ - Go 1.26.2+
- Node.js 20+ (for frontend build) - Node.js 20+ (for frontend build)
- Make (optional, for convenience commands) - Make (optional, for convenience commands)
- Docker (optional, for containerized deployment) - Docker (optional, for containerized deployment)
@@ -69,7 +69,7 @@ All configuration is via environment variables. See `.env.example` for the full
## Architecture ## Architecture
- **Backend**: Go 1.25, Chi router, PostgreSQL (pgx) - **Backend**: Go 1.26.2, Chi router, PostgreSQL (pgx)
- **Frontend**: React 18, Vite, TypeScript, Zustand, react-router-dom, react-i18next - **Frontend**: React 18, Vite, TypeScript, Zustand, react-router-dom, react-i18next
- **Real-time**: Socket.IO for collaborative canvas sync - **Real-time**: Socket.IO for collaborative canvas sync
- **Auth**: Session cookies (httpOnly, SameSite=Lax) + bcrypt password hashing + OAuth/OIDC - **Auth**: Session cookies (httpOnly, SameSite=Lax) + bcrypt password hashing + OAuth/OIDC
+1 -1
View File
@@ -22,7 +22,7 @@ RUN npm run build
# ------------------------------------------------------------------- # -------------------------------------------------------------------
# Stage 2: Backend build # Stage 2: Backend build
# ------------------------------------------------------------------- # -------------------------------------------------------------------
FROM --platform=$BUILDPLATFORM golang:1.23-alpine AS backend-builder FROM --platform=$BUILDPLATFORM golang:1.26.2-alpine AS backend-builder
RUN apk add --no-cache git ca-certificates RUN apk add --no-cache git ca-certificates
WORKDIR /app WORKDIR /app
COPY go.mod go.sum ./ COPY go.mod go.sum ./
+1 -1
View File
@@ -1,6 +1,6 @@
module excalidraw-complete module excalidraw-complete
go 1.23 go 1.26.2
require ( require (
github.com/aws/aws-sdk-go-v2 v1.26.0 github.com/aws/aws-sdk-go-v2 v1.26.0