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
40 changes: 34 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,47 @@ on:
branches: [ main ]

jobs:
test:
unit-test:
name: Unit Tests (Docker)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run Unit Tests
run: ./test/run-docker.sh

e2e-test:
name: E2E Tests (Playwright)
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.57.0-jammy
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'


# Git is required in the container to perform plumbing operations during E2E tests
- name: Install Git
run: apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/*

- name: Configure Git User
run: |
git config --global user.email "ci@git-cms.local"
git config --global user.name "CI Bot"
git config --global init.defaultBranch main

- name: Install Dependencies
run: npm ci

- name: Run Tests (Docker)
run: npm test
- name: Run Playwright Tests
run: npm run test:e2e

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# git-cms

<img src="./docs/images/hero.png" width="600" alt="Burnt-Out Linux Penguin" align="right" />

A serverless, database-free CMS built on Git plumbing.

> "I'm using `git push` as my API endpoint."
Expand Down Expand Up @@ -35,7 +37,7 @@ npm run dev
# OR
docker compose up app
```
The API and Admin UI will be available at `http://localhost:4637`.
The API and Admin UI will be available at `http://localhost:4638`.

### Run Tests
```bash
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ services:
- .:/app
- /app/node_modules
ports:
- "4637:4637"
- "4638:4638"
environment:
- PORT=4637
- PORT=4638
- GIT_CMS_ENV=dev
command: npm run serve

Expand Down
Binary file added docs/images/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { parseArticleCommit } from '../lib/parse.js';
import { chunkFileToRef } from '../lib/chunks.js';

const __dirname = path.dirname(new URL(import.meta.url).pathname);
const PORT = process.env.PORT || 4637;
const PORT = process.env.PORT || 4638;
const CWD = process.env.GIT_CMS_REPO || process.cwd();
const ENV = (process.env.GIT_CMS_ENV || 'dev').toLowerCase();
const REF_PREFIX = process.env.CMS_REF_PREFIX || `refs/_blog/${ENV}`;
Expand Down
7 changes: 7 additions & 0 deletions vitest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig, defaultExclude } from 'vitest/config';

export default defineConfig({
test: {
exclude: [...defaultExclude, 'test/e2e/**'],
},
});