feat: Hello World CI/CD — vitest + webhook to Hermes
Some checks failed
CI / Test → Hello World (push) Failing after 26s

This commit is contained in:
root
2026-05-23 02:27:12 +00:00
commit 60d47f2b7f
6 changed files with 1640 additions and 0 deletions

23
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,23 @@
name: CI
on:
push:
branches: [main]
jobs:
test:
name: Test → Hello World
runs-on: ubuntu-latest
container: node:22-alpine
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npx vitest run
- name: Phone home to Hermes
run: |
PAYLOAD='{"repository":{"name":"${{ github.repository }}"},"status":"success","message":"Hello World"}'
SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "${{ secrets.WEBHOOK_SECRET }}" | cut -d' ' -f2)
curl -sf -X POST http://100.93.173.42:8644/webhooks/ci-demo \
-H "Content-Type: application/json" \
-H "X-Hub-Signature-256: sha256=$SIGNATURE" \
-d "$PAYLOAD" && echo "Webhook delivered" || echo "Webhook failed (non-fatal)"

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
node_modules
dist

1592
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

12
package.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "ci-hello-world",
"private": true,
"version": "1.0.0",
"type": "module",
"scripts": {
"test": "vitest run"
},
"devDependencies": {
"vitest": "^3.0.0"
}
}

3
src/greet.ts Normal file
View File

@@ -0,0 +1,3 @@
export function greet(name: string): string {
return `Hello, ${name}!`;
}

8
tests/greet.test.ts Normal file
View File

@@ -0,0 +1,8 @@
import { describe, it, expect } from "vitest";
import { greet } from "../src/greet";
describe("greet", () => {
it('returns "Hello, World!"', () => {
expect(greet("World")).toBe("Hello, World!");
});
});