Skip to content

Commit e7c47ac

Browse files
committed
tests: bootstrap test with minimal acceptable code coverage
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent 8df8f77 commit e7c47ac

33 files changed

Lines changed: 1732 additions & 177 deletions

.github/dependabot.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ version: 2
33
updates:
44
- package-ecosystem: "npm"
55
open-pull-requests-limit: 20
6-
directory: "/"
6+
directories:
7+
- "application/"
78
versioning-strategy: increase
89
schedule:
910
interval: "weekly"
@@ -31,7 +32,8 @@ updates:
3132

3233
- package-ecosystem: github-actions
3334
open-pull-requests-limit: 20
34-
directory: "/"
35+
directories:
36+
- "/"
3537
schedule:
3638
interval: weekly
3739
groups:
@@ -44,7 +46,13 @@ updates:
4446
directory: "/"
4547
schedule:
4648
interval: weekly
49+
50+
- package-ecosystem: "docker"
51+
open-pull-requests-limit: 20
52+
directory: "/"
53+
schedule:
54+
interval: "weekly"
4755
groups:
48-
devcontainers-dependencies:
56+
docker-dependencies:
4957
patterns:
5058
- "*"

.github/workflows/__shared-ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,25 @@ name: Common Continuous Integration tasks
22

33
on:
44
workflow_call:
5+
outputs:
6+
build-artifact-id:
7+
description: "The build artifact ID"
8+
value: ${{ jobs.continuous-integration.outputs.build-artifact-id }}
59

6-
permissions:
7-
contents: read
8-
security-events: write
9-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
10-
id-token: write
10+
permissions: {}
1111

1212
jobs:
1313
continuous-integration:
14-
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@5c1010a9146952f724730bf79ba8e2e40ba8e474 # 0.11.0
14+
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@c9d9d041ba4ef35695ee469c4782fa6a8bbebbcc # 0.21.2
15+
permissions:
16+
contents: read
17+
id-token: write
18+
packages: read
19+
pull-requests: write
20+
security-events: write
1521
with:
1622
working-directory: application
17-
test: false
1823
build: |
1924
{
20-
"artifact": ["application/dist"]
25+
"artifact": ["dist"]
2126
}

.github/workflows/greetings.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ on:
66
pull_request_target:
77
branches: [main]
88

9-
permissions:
10-
contents: read
11-
issues: write
12-
pull-requests: write
9+
permissions: {}
1310

1411
jobs:
1512
greetings:
16-
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@95664be4ec235bfc221c4356c7153cbab3fb8f93 # 0.22.3
13+
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@0.31.7
14+
permissions:
15+
contents: read
16+
issues: write
17+
pull-requests: write

.github/workflows/main-ci.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010
cancel-in-progress: true
1111

12+
permissions: {}
13+
1214
jobs:
1315
ci:
1416
uses: ./.github/workflows/__shared-ci.yml
1517
secrets: inherit
1618
permissions:
1719
contents: read
18-
security-events: write
19-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
2020
id-token: write
21+
packages: read
22+
pull-requests: write
23+
security-events: write
2124

2225
deploy:
23-
if: github.ref == 'refs/heads/main'
26+
if: github.ref_name == github.event.repository.default_branch
2427
name: Deploy website
2528
needs: ci
2629
runs-on: ubuntu-latest
@@ -30,8 +33,11 @@ jobs:
3033
environment:
3134
name: github-pages
3235
url: ${{ steps.deployment.outputs.url }}
36+
outputs:
37+
url: ${{ steps.deployment.outputs.url }}
3338
steps:
3439
- id: deployment
35-
uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@e38260241de6b96a9f21834ca2d399789013e7ff # 0.5.1
40+
uses: hoverkraft-tech/ci-github-publish/actions/deploy/github-pages@0.21.0
3641
with:
37-
build-assets-path: application/dist
42+
build-path: application/dist
43+
build-artifact-id: ${{ needs.ci.outputs.build-artifact-id }}

.github/workflows/need-fix-to-issue.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ on:
1616
before it; to go back further, enter an earlier SHA here"
1717
required: false
1818

19-
permissions:
20-
contents: read
21-
issues: write
19+
permissions: {}
2220

2321
jobs:
2422
main:
25-
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@95664be4ec235bfc221c4356c7153cbab3fb8f93 # 0.22.3
23+
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@0.31.7
24+
permissions:
25+
contents: read
26+
issues: write
2627
with:
2728
manual-commit-ref: ${{ inputs.manual-commit-ref }}
2829
manual-base-ref: ${{ inputs.manual-base-ref }}

.github/workflows/pull-request-ci.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ on:
55
pull_request:
66
branches: [main]
77

8-
permissions:
9-
contents: read
10-
security-events: write
11-
# FIXME: This is a workaround for having workflow ref. See https://github.com/orgs/community/discussions/38659
12-
id-token: write
13-
148
concurrency:
159
group: ${{ github.workflow }}-${{ github.ref }}
1610
cancel-in-progress: true
1711

12+
permissions: {}
13+
1814
jobs:
1915
ci:
2016
uses: ./.github/workflows/__shared-ci.yml
2117
secrets: inherit
18+
permissions:
19+
contents: read
20+
id-token: write
21+
packages: read
22+
pull-requests: write
23+
security-events: write

.github/workflows/semantic-pull-request.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ on:
77
- edited
88
- synchronize
99

10-
permissions:
11-
contents: write
12-
pull-requests: write
10+
permissions: {}
1311

1412
jobs:
1513
main:
16-
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@95664be4ec235bfc221c4356c7153cbab3fb8f93 # 0.22.3
14+
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@0.31.7
15+
permissions:
16+
contents: write
17+
pull-requests: write

.github/workflows/stale.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ on:
44
schedule:
55
- cron: "30 1 * * *"
66

7-
permissions:
8-
issues: write
9-
pull-requests: write
7+
permissions: {}
108

119
jobs:
1210
main:
13-
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@95664be4ec235bfc221c4356c7153cbab3fb8f93 # 0.22.3
11+
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@0.31.7
12+
permissions:
13+
issues: write
14+
pull-requests: write

Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ include .env
1010

1111
setup: ## Prepare stack to run
1212
cd application && npm install
13-
cd .github/actions/generate-blog-post && npm install
14-
cd .github/actions/generate-brand-content && npm install
15-
cd .github/actions/validate-manifest && npm install
1613

1714
start: ## Start application in dev mode
1815
cd application && npm run start
1916

2017
lint: ## Run linters
21-
cd application && npm run lint -- $(filter-out $@,$(MAKECMDGOALS))
18+
cd application && npm run lint:ci -- $(filter-out $@,$(MAKECMDGOALS))
2219
$(call run_linter,)
2320

2421
lint-fix: ## Run linters
25-
cd application && npm audit --omit=dev
26-
cd application && npm run humanize:fix
22+
cd application && npm audit fix
23+
cd application && npx update-browserslist-db@latest
2724
cd application && npm run lint:fix
2825
$(MAKE) linter-fix
2926

@@ -32,9 +29,6 @@ build: ## Build libs and applications
3229

3330
test: ## Run tests
3431
cd application && npm run test:ci
35-
cd .github/actions/generate-blog-post && npm run test:ci
36-
cd .github/actions/generate-brand-content && npm run test:ci
37-
cd .github/actions/validate-manifest && npm run test:ci
3832

3933
ci: ## Run tests in CI mode
4034
$(MAKE) lint-fix

README.md

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Cloud Native Provence — Landing Page
22

3-
Astro-based conference website with bilingual routing (`fr` / `en`) and translated slugs.
3+
Conference website for Cloud Native Provence, with bilingual routing (`fr` / `en`) and translated page slugs.
44

5-
## Development workflow (Makefile-first)
5+
## Development workflow
66

77
Use `make` commands from the repository root.
88

@@ -15,21 +15,28 @@ Main targets:
1515
- `make setup` — install project dependencies
1616
- `make start` — start local dev server (`application`)
1717
- `make build` — production build
18+
- `make test-app` — run application tests with coverage
1819
- `make lint` — run linters/checks
1920
- `make lint-fix` — run fixers
2021
- `make ci` — lint + build + test pipeline
2122

22-
Do not run `npm run ...` directly unless you are explicitly debugging Makefile behavior.
23+
## Tests and coverage
24+
25+
Tests run with Vitest from `application/`.
26+
27+
```bash
28+
make test
29+
```
2330

2431
## Dev Container
2532

2633
This repository includes a VS Code Dev Container in `.devcontainer/devcontainer.json`.
2734

28-
### Recommended usage
35+
Quick start:
2936

3037
1. Open the repository in VS Code.
3138
2. Run `Dev Containers: Reopen in Container`.
32-
3. Once inside the container, run:
39+
3. Inside the container:
3340

3441
```bash
3542
make setup
@@ -45,31 +52,36 @@ The dev container provides:
4552

4653
The app is available on port `4321`.
4754

48-
## Current routing model
55+
## Routing model
4956

50-
Routing is locale-first and centralized.
57+
Routing is locale-first and centralized:
5158

5259
- `/` redirects to `/fr`
5360
- `/fr` and `/en` are localized homepages
54-
- `/{lang}/{translated-slug}` for content pages
61+
- `/{lang}/{translated-slug}` serves localized content pages
5562

5663
Key files:
5764

5865
- `application/src/pages/index.astro` — root redirect
5966
- `application/src/pages/[lang]/index.astro` — localized homepage
6067
- `application/src/pages/[lang]/[page].astro` — localized dynamic pages
61-
- `application/src/i18n/routes.ts`route slug mapping + path helpers
68+
- `application/src/i18n/routes.ts` — slug mapping and path translation helpers
6269

63-
Example translated slugs:
70+
Translated static pages:
6471

65-
- FR: `/fr/a-propos`, `/fr/charte-graphique`, `/fr/politique-de-confidentialite`
66-
- EN: `/en/about`, `/en/brand-guidelines`, `/en/privacy-policy`
72+
- `about``/fr/a-propos` / `/en/about`
73+
- `contact``/fr/contact` / `/en/contact`
74+
- `sponsoring``/fr/sponsoring` / `/en/sponsoring`
75+
- `brand-guidelines``/fr/charte-graphique` / `/en/brand-guidelines`
76+
- `terms``/fr/conditions-generales-utilisation` / `/en/terms-of-service`
77+
- `privacy``/fr/politique-de-confidentialite` / `/en/privacy-policy`
6778

68-
## Project structure (current)
79+
## Project structure
6980

7081
```text
7182
/
7283
├── .devcontainer/
84+
├── .github/
7385
├── Makefile
7486
├── Dockerfile
7587
├── README.md
@@ -79,41 +91,37 @@ Example translated slugs:
7991
├── public/
8092
│ ├── _headers
8193
│ ├── robots.txt
82-
│ └── .well-known/appspecific/com.chrome.devtools.json
83-
└── src/
84-
├── assets/
85-
├── components/
86-
├── i18n/
87-
│ ├── ui.ts
88-
│ ├── utils.ts
89-
│ └── routes.ts
90-
├── layouts/
91-
├── pages/
92-
│ ├── [lang]/
93-
│ │ ├── index.astro
94-
│ │ └── [page].astro
95-
│ ├── [...blog]/
96-
│ ├── home/
97-
│ ├── about/
98-
│ ├── contact/
99-
│ ├── sponsoring/
100-
│ ├── brand-guidelines/
101-
│ ├── terms/
102-
│ ├── privacy/
103-
│ ├── index.astro
104-
│ ├── rss.xml.ts
105-
│ └── 404.astro
106-
└── utils/
94+
│ └── logos/
95+
├── src/
96+
│ ├── assets/
97+
│ ├── components/
98+
│ ├── content/
99+
│ ├── data/
100+
│ ├── i18n/
101+
│ ├── layouts/
102+
│ ├── pages/
103+
│ │ ├── [...blog]/
104+
│ │ ├── [lang]/
105+
│ │ ├── about/
106+
│ │ ├── brand-guidelines/
107+
│ │ ├── contact/
108+
│ │ ├── home/
109+
│ │ ├── privacy/
110+
│ │ ├── sponsoring/
111+
│ │ ├── terms/
112+
│ │ ├── 404.astro
113+
│ │ ├── index.astro
114+
│ │ └── rss.xml.ts
115+
│ └── utils/
116+
└── vendor/
107117
```
108118

109-
## Configuration
110-
111-
Primary site configuration: `application/src/config.yaml`.
112-
113-
Astro framework configuration: `application/astro.config.ts`.
119+
## Configuration and build
114120

115-
## Build output
121+
- Site and app settings: `application/src/config.yaml`
122+
- Astro configuration and integrations: `application/astro.config.ts`
123+
- Static build output: `application/dist/`
116124

117-
Production build output is generated in:
125+
## CI
118126

119-
- `application/dist/`
127+
GitHub Actions CI runs from the `application/` directory and builds the static site output in `application/dist`.

0 commit comments

Comments
 (0)