CI: Add more checks to standalone docs pipeline (#46449)

* Add build frontend package step

* Reorder dependencies

* Add codespell and prettier checks
This commit is contained in:
Dimitris Sotirakis 2022-03-11 16:48:23 +02:00 committed by GitHub
parent cb0b089d32
commit 82b436afee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 87 additions and 14 deletions

View File

@ -437,13 +437,41 @@ steps:
image: grafana/build-container:1.5.2 image: grafana/build-container:1.5.2
name: initialize name: initialize
- commands: - commands:
- yarn packages:build - |-
- yarn packages:docsExtract echo -e "unknwon
- yarn packages:docsToMarkdown referer
- ./scripts/ci-reference-docs-lint.sh ci errorstring
eror
iam
wan" > words_to_ignore.txt
- codespell -I words_to_ignore.txt docs/
- rm words_to_ignore.txt
depends_on: depends_on:
- initialize - initialize
image: grafana/build-container:1.5.2 image: grafana/build-container:1.5.2
name: codespell
- commands:
- yarn run prettier:checkDocs
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.5.2
name: lint-docs
- commands:
- ./bin/grabpl build-frontend-packages --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
--no-pull-enterprise
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.5.2
name: build-frontend-packages
- commands:
- ./scripts/ci-reference-docs-lint.sh ci
depends_on:
- build-frontend-packages
image: grafana/build-container:1.5.2
name: build-frontend-docs name: build-frontend-docs
- commands: - commands:
- mkdir -p /hugo/content/docs/grafana - mkdir -p /hugo/content/docs/grafana
@ -493,13 +521,41 @@ steps:
image: grafana/build-container:1.5.2 image: grafana/build-container:1.5.2
name: initialize name: initialize
- commands: - commands:
- yarn packages:build - |-
- yarn packages:docsExtract echo -e "unknwon
- yarn packages:docsToMarkdown referer
- ./scripts/ci-reference-docs-lint.sh ci errorstring
eror
iam
wan" > words_to_ignore.txt
- codespell -I words_to_ignore.txt docs/
- rm words_to_ignore.txt
depends_on: depends_on:
- initialize - initialize
image: grafana/build-container:1.5.2 image: grafana/build-container:1.5.2
name: codespell
- commands:
- yarn run prettier:checkDocs
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.5.2
name: lint-docs
- commands:
- ./bin/grabpl build-frontend-packages --jobs 8 --edition oss --build-id ${DRONE_BUILD_NUMBER}
--no-pull-enterprise
depends_on:
- initialize
environment:
NODE_OPTIONS: --max_old_space_size=8192
image: grafana/build-container:1.5.2
name: build-frontend-packages
- commands:
- ./scripts/ci-reference-docs-lint.sh ci
depends_on:
- build-frontend-packages
image: grafana/build-container:1.5.2
name: build-frontend-docs name: build-frontend-docs
- commands: - commands:
- mkdir -p /hugo/content/docs/grafana - mkdir -p /hugo/content/docs/grafana
@ -4330,6 +4386,6 @@ kind: secret
name: gcp_upload_artifacts_key name: gcp_upload_artifacts_key
--- ---
kind: signature kind: signature
hmac: 2d48c15c46e95a72e8fc0715b405f17e770512a68a6526be08ca5e9f21a307f2 hmac: 5436fa85451361525a2d8b9c40b632623bd05ddd89f76095310b359de7993f11
... ...

View File

@ -38,6 +38,7 @@
"packages:clean": "lerna run clean", "packages:clean": "lerna run clean",
"precommit": "yarn run lint-staged", "precommit": "yarn run lint-staged",
"prettier:check": "prettier --check --list-different=false --loglevel=warn \"**/*.{ts,tsx,scss,md,mdx}\"", "prettier:check": "prettier --check --list-different=false --loglevel=warn \"**/*.{ts,tsx,scss,md,mdx}\"",
"prettier:checkDocs": "prettier --check --list-different=false --loglevel=warn \"docs/**.md\" \"packages/**.{ts,tsx,scss,md,mdx}\"",
"prettier:write": "prettier --list-different \"**/*.{js,ts,tsx,scss,md,mdx}\" --write", "prettier:write": "prettier --list-different \"**/*.{js,ts,tsx,scss,md,mdx}\" --write",
"start": "yarn themes:generate && yarn dev --watch", "start": "yarn themes:generate && yarn dev --watch",
"start:noTsCheck": "yarn start --env noTsCheck=1", "start:noTsCheck": "yarn start --env noTsCheck=1",

View File

@ -1,13 +1,14 @@
load( load(
'scripts/drone/steps/lib.star', 'scripts/drone/steps/lib.star',
'build_image',
'initialize_step', 'initialize_step',
'download_grabpl_step', 'download_grabpl_step',
'lint_frontend_step', 'lint_frontend_step',
'codespell_step', 'codespell_step',
'shellcheck_step',
'test_frontend_step', 'test_frontend_step',
'build_storybook_step', 'build_storybook_step',
'build_frontend_docs_step', 'build_frontend_docs_step',
'build_frontend_package_step',
'build_docs_website_step', 'build_docs_website_step',
) )
@ -28,6 +29,9 @@ def docs_pipelines(edition, ver_mode, trigger):
# Insert remaining steps # Insert remaining steps
steps.extend([ steps.extend([
codespell_step(),
lint_docs(),
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_frontend_docs_step(edition=edition), build_frontend_docs_step(edition=edition),
build_docs_website_step(), build_docs_website_step(),
]) ])
@ -36,6 +40,21 @@ def docs_pipelines(edition, ver_mode, trigger):
name='{}-docs'.format(ver_mode), edition=edition, trigger=trigger, services=[], steps=steps, name='{}-docs'.format(ver_mode), edition=edition, trigger=trigger, services=[], steps=steps,
) )
def lint_docs():
return {
'name': 'lint-docs',
'image': build_image,
'depends_on': [
'initialize',
],
'environment': {
'NODE_OPTIONS': '--max_old_space_size=8192',
},
'commands': [
'yarn run prettier:checkDocs',
],
}
def trigger_docs(): def trigger_docs():
return { return {

View File

@ -458,12 +458,9 @@ def build_frontend_docs_step(edition):
'name': 'build-frontend-docs', 'name': 'build-frontend-docs',
'image': build_image, 'image': build_image,
'depends_on': [ 'depends_on': [
'initialize' 'build-frontend-packages'
], ],
'commands': [ 'commands': [
'yarn packages:build',
'yarn packages:docsExtract',
'yarn packages:docsToMarkdown',
'./scripts/ci-reference-docs-lint.sh ci', './scripts/ci-reference-docs-lint.sh ci',
] ]
} }