Skip to content

Commit 18b60f5

Browse files
hoverkraft-bot[bot]neilime
authored andcommitted
docs:(golden-paths): separate single app from multi apps for GitHub CI
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
1 parent ce18071 commit 18b60f5

File tree

91 files changed

+901
-877
lines changed

Some content is hidden

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

91 files changed

+901
-877
lines changed

.github/actions/generate-docs/package-lock.json

Lines changed: 2 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/inject-docs/package-lock.json

Lines changed: 2 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/prepare-docs/package-lock.json

Lines changed: 2 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/resolve-docs-target/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Responsibilities:
5555
| **Input** | **Description** | **Required** | **Default** |
5656
| ------------------ | ----------------------------------------------------- | ------------ | ----------- |
5757
| **`github-token`** | GitHub token used to authenticate repository queries. | **true** | - |
58-
| **`repository`** | Repository slug in the form owner/repo. | **true** | - |
58+
| **`repository`** | Repository slug in the form owner/repository. | **true** | - |
5959

6060
<!-- inputs:end -->
6161
<!-- secrets:start -->

.github/actions/resolve-docs-target/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ inputs:
1313
description: GitHub token used to authenticate repository queries.
1414
required: true
1515
repository:
16-
description: Repository slug in the form owner/repo.
16+
description: Repository slug in the form `owner/repo`.
1717
required: true
1818

1919
outputs:

.github/actions/resolve-docs-target/package-lock.json

Lines changed: 2 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/sync-docs-dispatcher.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ For repositories with strict yamllint rules (e.g., line length limits):
148148
# Single line format (preferred for yamllint compatibility)
149149
uses: hoverkraft-tech/public-docs/.github/workflows/sync-docs-dispatcher.yml@18facec04f2945f4d66d510e8a06568497b73c54 # 0.1.0
150150
151+
151152
# If line is too long, yamllint may still complain - consider:
152153
# 1. Disabling line-length for specific lines
153154
# 2. Using shorter variable names

Makefile

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,36 @@ help: ## Show help message
88

99
include .env
1010

11-
prepare: ## Prepare stack to run
12-
npm --prefix application install
13-
npm --prefix .github/actions/generate-docs install
14-
npm --prefix .github/actions/prepare-docs install
15-
npm --prefix .github/actions/inject-docs install
16-
npm --prefix .github/actions/resolve-docs-target install
11+
setup: ## Install npm dependencies for all package.json files under actions/
12+
@echo "Installing npm dependencies for all packages..."
13+
$(call run_npm_for_packages,install)
1714

1815
start: ## Start application in dev mode
1916
npm --prefix application run start
2017

18+
npm-audit-fix: ## Execute npm audit fix
19+
@echo "Running npm audit fix for all packages..."
20+
$(call run_npm_for_packages,audit fix)
21+
2122
lint: ## Run linters
2223
npm --prefix application run lint -- $(filter-out $@,$(MAKECMDGOALS))
2324
$(call run_linter,)
2425

2526
lint-fix: ## Run linters
2627
npm --prefix application run lint:fix
27-
npm --prefix application audit fix
28-
npm --prefix .github/actions/generate-docs audit fix
29-
npm --prefix .github/actions/prepare-docs audit fix
30-
npm --prefix .github/actions/inject-docs audit fix
31-
npm --prefix .github/actions/resolve-docs-target audit fix
3228
$(MAKE) linter-fix
3329

3430
build: ## Build libs and applications
3531
npm --prefix application run build
3632

3733
test: ## Run tests
38-
npm --prefix application run test:ci
39-
npm --prefix .github/actions/generate-docs run test:ci
40-
npm --prefix .github/actions/prepare-docs run test:ci
41-
npm --prefix .github/actions/inject-docs run test:ci
42-
npm --prefix .github/actions/resolve-docs-target run test:ci
34+
@echo "Running tests for all packages..."
35+
$(call run_npm_for_packages,test:ci)
4336

4437
ci: ## Run tests in CI mode
45-
$(MAKE) prepare
38+
$(MAKE) setup
4639
$(MAKE) lint-fix
40+
$(MAKE) npm-audit-fix || true
4741
$(MAKE) build
4842
$(MAKE) test
4943

@@ -75,15 +69,19 @@ define run_linter
7569
$$LINTER_IMAGE
7670
endef
7771

78-
define docker-compose
79-
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml -f docker-compose.local.yml -f docker-compose.$(1).yml $(2)
80-
endef
81-
82-
define open-in-browser
83-
@if command -v x-www-browser &> /dev/null ; then x-www-browser $(1); \
84-
elif command -v xdg-open &> /dev/null ; then xdg-open $(1); \
85-
elif command -v open &> /dev/null ; then open $(1); \
86-
elif command -v start &> /dev/null ; then start $(1); fi;
72+
define run_npm_for_packages
73+
@set -uo pipefail; \
74+
overall_status=0; \
75+
packages="$$(find application .github/actions -type f -name package.json -not -path '*/node_modules/*' -print | sort)"; \
76+
for pkg in $$packages; do \
77+
pkg_dir="$$(dirname "$$pkg")"; \
78+
echo "---"; \
79+
echo "npm $(1) in $$pkg_dir"; \
80+
if ! npm --prefix "$$pkg_dir" $(1); then \
81+
overall_status=1; \
82+
fi; \
83+
done; \
84+
exit $$overall_status
8785
endef
8886

8987
#############################

0 commit comments

Comments
 (0)