Skip to content

Commit 3e22f61

Browse files
committed
feat: first commit
1 parent 7bb9539 commit 3e22f61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+21925
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
name: Build Docusaurus
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
cache: 'npm'
31+
32+
- name: Install dependencies
33+
run: npm ci
34+
35+
- name: Build website
36+
run: npm run build
37+
env:
38+
GITHUB_ACTIONS: true
39+
40+
- name: Upload build artifact
41+
uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: ./build
44+
45+
deploy:
46+
name: Deploy to GitHub Pages
47+
needs: build
48+
runs-on: ubuntu-latest
49+
environment:
50+
name: github-pages
51+
url: ${{ steps.deployment.outputs.page_url }}
52+
steps:
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.github/workflows/test.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: E2E Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
test:
14+
name: Run E2E Tests
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 15
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Install Playwright browsers
31+
run: npx playwright install --with-deps
32+
33+
- name: Build Docusaurus
34+
run: npm run build
35+
36+
- name: Run Playwright tests
37+
run: |
38+
npm run serve &
39+
SERVER_PID=$!
40+
41+
# Wait for server to be ready
42+
echo "Waiting for server to be ready..."
43+
max_attempts=30
44+
attempt=0
45+
while [ $attempt -lt $max_attempts ]; do
46+
if curl -s http://localhost:3000 > /dev/null 2>&1; then
47+
echo "Server is ready!"
48+
break
49+
fi
50+
attempt=$((attempt + 1))
51+
sleep 1
52+
done
53+
54+
# Run tests
55+
export PLAYWRIGHT_JUNIT_OUTPUT_FILE=test-results/junit.xml
56+
npx playwright test --reporter=junit,html,list || TEST_EXIT_CODE=$?
57+
58+
# Stop server
59+
kill $SERVER_PID || true
60+
61+
# Exit with test result
62+
exit ${TEST_EXIT_CODE:-0}
63+
64+
- name: Upload test results (JUnit XML)
65+
if: always()
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: test-results-junit
69+
path: test-results/junit.xml
70+
retention-days: 30
71+
72+
- name: Upload test results (HTML Report)
73+
if: always()
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: test-results-html
77+
path: test-results/html/
78+
retention-days: 30
79+
80+
- name: Upload test screenshots (on failure)
81+
if: failure()
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: test-screenshots
85+
path: test-results/
86+
retention-days: 30
87+
88+
- name: Publish test results summary
89+
if: always()
90+
run: |
91+
if [ -f test-results/junit.xml ]; then
92+
echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
93+
echo "" >> $GITHUB_STEP_SUMMARY
94+
95+
# Extract test counts (basic parsing)
96+
tests=$(grep -oP 'tests="\K[^"]+' test-results/junit.xml | head -1 || echo "N/A")
97+
failures=$(grep -oP 'failures="\K[^"]+' test-results/junit.xml | head -1 || echo "N/A")
98+
99+
echo "- **Total Tests:** $tests" >> $GITHUB_STEP_SUMMARY
100+
echo "- **Failures:** $failures" >> $GITHUB_STEP_SUMMARY
101+
echo "" >> $GITHUB_STEP_SUMMARY
102+
echo "📊 [View detailed HTML report in artifacts](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})" >> $GITHUB_STEP_SUMMARY
103+
fi

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Test results
12+
/test-results/
13+
/playwright-report/
14+
15+
# Misc
16+
.DS_Store
17+
.env.local
18+
.env.development.local
19+
.env.test.local
20+
.env.production.local
21+
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*

0 commit comments

Comments
 (0)