Skip to content

Commit da7a247

Browse files
committed
chore(release): v0.0.6
1 parent 38c3058 commit da7a247

File tree

7 files changed

+391
-16
lines changed

7 files changed

+391
-16
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,8 @@ jobs:
2929
node-version: '20'
3030
cache: 'npm'
3131

32-
- name: Install dependencies
33-
run: npm ci
34-
35-
- name: Build website
36-
run: npm run build
37-
env:
38-
BUILD_FOR_GITHUB_PAGES: true
32+
- name: Run deployment script
33+
run: bash scripts/deploy.sh --ci
3934

4035
- name: Upload build artifact
4136
uses: actions/upload-pages-artifact@v3

docs/test-reports.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ Nous utilisons [Playwright](https://playwright.dev/) pour les tests end-to-end s
1212

1313
## Derniers rapports de tests
1414

15+
### 🌐 Rapports de tests déployés
16+
17+
Les rapports de tests les plus récents sont automatiquement déployés sur le site web et accessibles directement via les liens suivants:
18+
19+
- **📈 [Rapport HTML interactif](https://sophiahacklab.github.io/docusaurus/test-reports/index.html)** - Visualisation complète avec captures d'écran et détails
20+
- **📊 [Rapport JUnit XML](https://sophiahacklab.github.io/docusaurus/test-reports/junit.xml)** - Format XML pour intégration CI/CD
21+
22+
Ces rapports sont mis à jour automatiquement à chaque déploiement sur la branche `main`.
23+
1524
### Rapports locaux
1625

1726
Après l'exécution des tests, deux rapports sont disponibles localement:

scripts/copy-test-reports.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,33 @@
55

66
set -e
77

8-
REPORTS_SOURCE="test-results/html"
8+
REPORTS_HTML_SOURCE="test-results/html"
9+
REPORTS_XML_SOURCE="test-results/junit.xml"
910
REPORTS_DEST="static/test-reports"
1011

11-
echo "Copying test reports from ${REPORTS_SOURCE} to ${REPORTS_DEST}..."
12+
echo "Copying test reports to ${REPORTS_DEST}..."
1213

13-
if [ -d "$REPORTS_SOURCE" ]; then
14-
mkdir -p "$REPORTS_DEST"
15-
cp -r "$REPORTS_SOURCE"/* "$REPORTS_DEST"/ 2>/dev/null || true
16-
echo "✓ Test reports copied successfully"
14+
# Create destination directory
15+
mkdir -p "$REPORTS_DEST"
16+
17+
# Copy HTML reports
18+
if [ -d "$REPORTS_HTML_SOURCE" ]; then
19+
cp -r "$REPORTS_HTML_SOURCE"/* "$REPORTS_DEST"/
20+
echo "✓ HTML test reports copied successfully"
1721
else
18-
echo "No test reports found at ${REPORTS_SOURCE}"
19-
echo " Skipping report copy..."
22+
echo "❌ ERROR: No HTML test reports found at ${REPORTS_HTML_SOURCE}"
23+
exit 1
2024
fi
2125

26+
# Copy XML report
27+
if [ -f "$REPORTS_XML_SOURCE" ]; then
28+
cp "$REPORTS_XML_SOURCE" "$REPORTS_DEST"/junit.xml
29+
echo "✓ XML test report copied successfully"
30+
else
31+
echo "❌ ERROR: No XML test report found at ${REPORTS_XML_SOURCE}"
32+
exit 1
33+
fi
34+
35+
echo "✓ Test reports copy completed"
36+
2237
exit 0

scripts/deploy.sh

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
#!/bin/bash
2+
3+
# Deploy Script for SophiaHackLab Docusaurus
4+
# This script handles the complete deployment workflow:
5+
# 1. Install dependencies
6+
# 2. Build site for testing
7+
# 3. Run E2E tests
8+
# 4. Copy test reports to static directory
9+
# 5. Build final site with test reports
10+
#
11+
# Usage:
12+
# ./scripts/deploy.sh # For local testing
13+
# ./scripts/deploy.sh --ci # For CI/CD (GitHub Actions)
14+
15+
set -e
16+
17+
# Colors for output
18+
RED='\033[0;31m'
19+
GREEN='\033[0;32m'
20+
YELLOW='\033[1;33m'
21+
BLUE='\033[0;34m'
22+
NC='\033[0m' # No Color
23+
24+
# Configuration
25+
IS_CI=false
26+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
27+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
28+
29+
# Parse arguments
30+
for arg in "$@"; do
31+
case $arg in
32+
--ci)
33+
IS_CI=true
34+
shift
35+
;;
36+
*)
37+
echo -e "${RED}Unknown argument: $arg${NC}"
38+
exit 1
39+
;;
40+
esac
41+
done
42+
43+
# Change to project root
44+
cd "$PROJECT_ROOT"
45+
46+
echo -e "${BLUE}════════════════════════════════════════════════════════${NC}"
47+
echo -e "${BLUE} SophiaHackLab Docusaurus Deployment${NC}"
48+
echo -e "${BLUE} Mode: $([ "$IS_CI" = true ] && echo "CI/CD" || echo "Local")${NC}"
49+
echo -e "${BLUE}════════════════════════════════════════════════════════${NC}"
50+
echo ""
51+
52+
# Step 1: Install dependencies
53+
echo -e "${YELLOW}[1/6] Installing dependencies...${NC}"
54+
if [ "$IS_CI" = true ]; then
55+
npm ci
56+
else
57+
npm install
58+
fi
59+
echo -e "${GREEN}✓ Dependencies installed${NC}"
60+
echo ""
61+
62+
# Step 2: Install Playwright browsers
63+
echo -e "${YELLOW}[2/6] Installing Playwright browsers...${NC}"
64+
npx playwright install --with-deps
65+
echo -e "${GREEN}✓ Playwright browsers installed${NC}"
66+
echo ""
67+
68+
# Step 3: Build site for testing
69+
echo -e "${YELLOW}[3/6] Building site for testing...${NC}"
70+
if [ "$IS_CI" = true ]; then
71+
BUILD_FOR_GITHUB_PAGES=true npm run build
72+
else
73+
npm run build
74+
fi
75+
echo -e "${GREEN}✓ Site built for testing${NC}"
76+
echo ""
77+
78+
# Step 4: Run E2E tests
79+
echo -e "${YELLOW}[4/6] Running E2E tests...${NC}"
80+
PLAYWRIGHT_JUNIT_OUTPUT_FILE=test-results/junit.xml npx playwright test
81+
echo -e "${GREEN}✓ E2E tests completed${NC}"
82+
echo ""
83+
84+
# Step 5: Copy test reports
85+
echo -e "${YELLOW}[5/6] Copying test reports to static directory...${NC}"
86+
bash "$SCRIPT_DIR/copy-test-reports.sh"
87+
echo -e "${GREEN}✓ Test reports copied${NC}"
88+
echo ""
89+
90+
# Step 6: Build final site with test reports
91+
echo -e "${YELLOW}[6/6] Building final site with test reports...${NC}"
92+
if [ "$IS_CI" = true ]; then
93+
BUILD_FOR_GITHUB_PAGES=true npm run build
94+
else
95+
npm run build
96+
fi
97+
echo -e "${GREEN}✓ Final site built with test reports${NC}"
98+
echo ""
99+
100+
echo -e "${GREEN}════════════════════════════════════════════════════════${NC}"
101+
echo -e "${GREEN} Deployment preparation completed successfully!${NC}"
102+
echo -e "${GREEN}════════════════════════════════════════════════════════${NC}"
103+
echo ""
104+
105+
if [ "$IS_CI" = false ]; then
106+
echo -e "${BLUE}To serve the site locally:${NC}"
107+
echo -e " npm run serve"
108+
echo ""
109+
echo -e "${BLUE}Test reports available at:${NC}"
110+
echo -e " http://localhost:3000/test-reports/index.html (HTML)"
111+
echo -e " http://localhost:3000/test-reports/junit.xml (XML)"
112+
fi
113+
114+
exit 0

static/test-reports/.gitkeep

Lines changed: 0 additions & 1 deletion
This file was deleted.

static/test-reports/index.html

Lines changed: 85 additions & 0 deletions
Large diffs are not rendered by default.

static/test-reports/junit.xml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
<testsuites id="" name="" tests="69" failures="0" skipped="0" errors="0" time="79.94339599999999">
2+
<testsuite name="homepage.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="chromium" tests="4" failures="0" skipped="0" time="14.853" errors="0">
3+
<testcase name="Homepage › should load successfully" classname="homepage.spec.ts" time="4.241">
4+
</testcase>
5+
<testcase name="Homepage › should display SophiaHackLab branding" classname="homepage.spec.ts" time="3.059">
6+
</testcase>
7+
<testcase name="Homepage › should have working navigation links" classname="homepage.spec.ts" time="3.768">
8+
</testcase>
9+
<testcase name="Homepage › should display tagline" classname="homepage.spec.ts" time="3.785">
10+
</testcase>
11+
</testsuite>
12+
<testsuite name="projects.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="chromium" tests="15" failures="0" skipped="0" time="61.347" errors="0">
13+
<testcase name="Project Pages › should load ROV project page" classname="projects.spec.ts" time="4.215">
14+
</testcase>
15+
<testcase name="Project Pages › should display ROV project content" classname="projects.spec.ts" time="4.618">
16+
</testcase>
17+
<testcase name="Project Pages › should have related pages for ROV" classname="projects.spec.ts" time="3.99">
18+
</testcase>
19+
<testcase name="Project Pages › should load Triviak Real project page" classname="projects.spec.ts" time="3.789">
20+
</testcase>
21+
<testcase name="Project Pages › should display Triviak Real project content" classname="projects.spec.ts" time="3.889">
22+
</testcase>
23+
<testcase name="Project Pages › should have related pages for Triviak Real" classname="projects.spec.ts" time="3.37">
24+
</testcase>
25+
<testcase name="Project Pages › should load Triviak Mini project page" classname="projects.spec.ts" time="3.366">
26+
</testcase>
27+
<testcase name="Project Pages › should display Triviak Mini project content" classname="projects.spec.ts" time="3.331">
28+
</testcase>
29+
<testcase name="Project Pages › should have related pages for Triviak Mini" classname="projects.spec.ts" time="3.383">
30+
</testcase>
31+
<testcase name="Project Pages › should load Fête de la Science project page" classname="projects.spec.ts" time="3.596">
32+
</testcase>
33+
<testcase name="Project Pages › should display Fête de la Science project content" classname="projects.spec.ts" time="3.019">
34+
</testcase>
35+
<testcase name="Project Pages › should have related pages for Fête de la Science" classname="projects.spec.ts" time="3.186">
36+
</testcase>
37+
<testcase name="Project Pages › should render markdown content correctly" classname="projects.spec.ts" time="2.584">
38+
</testcase>
39+
<testcase name="Project Pages › should have CONTRIBUTING page for each project" classname="projects.spec.ts" time="8.15">
40+
</testcase>
41+
<testcase name="Project Pages › should have TODO page for each project" classname="projects.spec.ts" time="6.861">
42+
</testcase>
43+
</testsuite>
44+
<testsuite name="sidebar.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="chromium" tests="4" failures="0" skipped="0" time="12.132" errors="0">
45+
<testcase name="Sidebar Navigation › should display sidebar on docs page" classname="sidebar.spec.ts" time="2.615">
46+
</testcase>
47+
<testcase name="Sidebar Navigation › should have projects section in sidebar" classname="sidebar.spec.ts" time="3.019">
48+
</testcase>
49+
<testcase name="Sidebar Navigation › should navigate to project pages from sidebar" classname="sidebar.spec.ts" time="3.74">
50+
</testcase>
51+
<testcase name="Sidebar Navigation › should show nested menu structure" classname="sidebar.spec.ts" time="2.758">
52+
</testcase>
53+
</testsuite>
54+
<testsuite name="homepage.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="firefox" tests="4" failures="0" skipped="0" time="26.271" errors="0">
55+
<testcase name="Homepage › should load successfully" classname="homepage.spec.ts" time="4.728">
56+
</testcase>
57+
<testcase name="Homepage › should display SophiaHackLab branding" classname="homepage.spec.ts" time="7.075">
58+
</testcase>
59+
<testcase name="Homepage › should have working navigation links" classname="homepage.spec.ts" time="5.465">
60+
</testcase>
61+
<testcase name="Homepage › should display tagline" classname="homepage.spec.ts" time="9.003">
62+
</testcase>
63+
</testsuite>
64+
<testsuite name="projects.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="firefox" tests="15" failures="0" skipped="0" time="90.61" errors="0">
65+
<testcase name="Project Pages › should load ROV project page" classname="projects.spec.ts" time="10.553">
66+
</testcase>
67+
<testcase name="Project Pages › should display ROV project content" classname="projects.spec.ts" time="9.532">
68+
</testcase>
69+
<testcase name="Project Pages › should have related pages for ROV" classname="projects.spec.ts" time="5.621">
70+
</testcase>
71+
<testcase name="Project Pages › should load Triviak Real project page" classname="projects.spec.ts" time="5.636">
72+
</testcase>
73+
<testcase name="Project Pages › should display Triviak Real project content" classname="projects.spec.ts" time="5.958">
74+
</testcase>
75+
<testcase name="Project Pages › should have related pages for Triviak Real" classname="projects.spec.ts" time="5.795">
76+
</testcase>
77+
<testcase name="Project Pages › should load Triviak Mini project page" classname="projects.spec.ts" time="5.067">
78+
</testcase>
79+
<testcase name="Project Pages › should display Triviak Mini project content" classname="projects.spec.ts" time="4.43">
80+
</testcase>
81+
<testcase name="Project Pages › should have related pages for Triviak Mini" classname="projects.spec.ts" time="4.592">
82+
</testcase>
83+
<testcase name="Project Pages › should load Fête de la Science project page" classname="projects.spec.ts" time="3.953">
84+
</testcase>
85+
<testcase name="Project Pages › should display Fête de la Science project content" classname="projects.spec.ts" time="3.772">
86+
</testcase>
87+
<testcase name="Project Pages › should have related pages for Fête de la Science" classname="projects.spec.ts" time="3.61">
88+
</testcase>
89+
<testcase name="Project Pages › should render markdown content correctly" classname="projects.spec.ts" time="3.329">
90+
</testcase>
91+
<testcase name="Project Pages › should have CONTRIBUTING page for each project" classname="projects.spec.ts" time="9.854">
92+
</testcase>
93+
<testcase name="Project Pages › should have TODO page for each project" classname="projects.spec.ts" time="8.908">
94+
</testcase>
95+
</testsuite>
96+
<testsuite name="sidebar.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="firefox" tests="4" failures="0" skipped="0" time="13.424" errors="0">
97+
<testcase name="Sidebar Navigation › should display sidebar on docs page" classname="sidebar.spec.ts" time="3.117">
98+
</testcase>
99+
<testcase name="Sidebar Navigation › should have projects section in sidebar" classname="sidebar.spec.ts" time="3.13">
100+
</testcase>
101+
<testcase name="Sidebar Navigation › should navigate to project pages from sidebar" classname="sidebar.spec.ts" time="3.95">
102+
</testcase>
103+
<testcase name="Sidebar Navigation › should show nested menu structure" classname="sidebar.spec.ts" time="3.227">
104+
</testcase>
105+
</testsuite>
106+
<testsuite name="homepage.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="webkit" tests="4" failures="0" skipped="0" time="17.346" errors="0">
107+
<testcase name="Homepage › should load successfully" classname="homepage.spec.ts" time="4.582">
108+
</testcase>
109+
<testcase name="Homepage › should display SophiaHackLab branding" classname="homepage.spec.ts" time="4.521">
110+
</testcase>
111+
<testcase name="Homepage › should have working navigation links" classname="homepage.spec.ts" time="4.4">
112+
</testcase>
113+
<testcase name="Homepage › should display tagline" classname="homepage.spec.ts" time="3.843">
114+
</testcase>
115+
</testsuite>
116+
<testsuite name="projects.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="webkit" tests="15" failures="0" skipped="0" time="77.546" errors="0">
117+
<testcase name="Project Pages › should load ROV project page" classname="projects.spec.ts" time="4.825">
118+
</testcase>
119+
<testcase name="Project Pages › should display ROV project content" classname="projects.spec.ts" time="4.326">
120+
</testcase>
121+
<testcase name="Project Pages › should have related pages for ROV" classname="projects.spec.ts" time="4.713">
122+
</testcase>
123+
<testcase name="Project Pages › should load Triviak Real project page" classname="projects.spec.ts" time="4.931">
124+
</testcase>
125+
<testcase name="Project Pages › should display Triviak Real project content" classname="projects.spec.ts" time="4.607">
126+
</testcase>
127+
<testcase name="Project Pages › should have related pages for Triviak Real" classname="projects.spec.ts" time="4.413">
128+
</testcase>
129+
<testcase name="Project Pages › should load Triviak Mini project page" classname="projects.spec.ts" time="4.838">
130+
</testcase>
131+
<testcase name="Project Pages › should display Triviak Mini project content" classname="projects.spec.ts" time="4.796">
132+
</testcase>
133+
<testcase name="Project Pages › should have related pages for Triviak Mini" classname="projects.spec.ts" time="4.696">
134+
</testcase>
135+
<testcase name="Project Pages › should load Fête de la Science project page" classname="projects.spec.ts" time="4.519">
136+
</testcase>
137+
<testcase name="Project Pages › should display Fête de la Science project content" classname="projects.spec.ts" time="4.774">
138+
</testcase>
139+
<testcase name="Project Pages › should have related pages for Fête de la Science" classname="projects.spec.ts" time="4.329">
140+
</testcase>
141+
<testcase name="Project Pages › should render markdown content correctly" classname="projects.spec.ts" time="3.374">
142+
</testcase>
143+
<testcase name="Project Pages › should have CONTRIBUTING page for each project" classname="projects.spec.ts" time="9.477">
144+
</testcase>
145+
<testcase name="Project Pages › should have TODO page for each project" classname="projects.spec.ts" time="8.928">
146+
</testcase>
147+
</testsuite>
148+
<testsuite name="sidebar.spec.ts" timestamp="2025-12-20T06:14:51.324Z" hostname="webkit" tests="4" failures="0" skipped="0" time="19.036" errors="0">
149+
<testcase name="Sidebar Navigation › should display sidebar on docs page" classname="sidebar.spec.ts" time="4.259">
150+
</testcase>
151+
<testcase name="Sidebar Navigation › should have projects section in sidebar" classname="sidebar.spec.ts" time="4.951">
152+
</testcase>
153+
<testcase name="Sidebar Navigation › should navigate to project pages from sidebar" classname="sidebar.spec.ts" time="5.082">
154+
</testcase>
155+
<testcase name="Sidebar Navigation › should show nested menu structure" classname="sidebar.spec.ts" time="4.744">
156+
</testcase>
157+
</testsuite>
158+
</testsuites>

0 commit comments

Comments
 (0)