diff --git a/.drone.yml b/.drone.yml index c8f77eeae82..0627c1a19be 100644 --- a/.drone.yml +++ b/.drone.yml @@ -49,6 +49,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -65,7 +77,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -309,6 +321,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -325,7 +349,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -773,6 +797,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -789,7 +825,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -1141,6 +1177,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -1157,7 +1205,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -1713,6 +1761,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -1729,7 +1789,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -2070,6 +2130,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -2086,7 +2158,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -2635,6 +2707,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -2651,7 +2735,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -2963,6 +3047,18 @@ steps: depends_on: - initialize +- name: lint-frontend + image: grafana/build-container:1.4.3 + commands: + - yarn run prettier:check + - yarn run lint + - yarn run typecheck + - yarn run check-strict + environment: + TEST_MAX_WORKERS: 50% + depends_on: + - initialize + - name: test-backend image: grafana/build-container:1.4.3 commands: @@ -2979,7 +3075,7 @@ steps: environment: TEST_MAX_WORKERS: 50% depends_on: - - lint-backend + - lint-frontend - name: build-backend image: grafana/build-container:1.4.3 @@ -3468,6 +3564,6 @@ get: --- kind: signature -hmac: 9d5ee57b9eff4ba3df8f70c8f7625c2ff1e07c2ce438182a97f81e6e8dbbb1dc +hmac: 1a0a169db008e1e64f43227aef586c8a6f6c763ce8ffb91923ac60d4f94ca33f ... diff --git a/package.json b/package.json index 4f0298fe3ee..e19efa8d0a3 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "scripts": { "api-tests": "jest --notify --watch --config=devenv/e2e-api-tests/jest.js", "build": "node ./node_modules/webpack/bin/webpack.js --config scripts/webpack/webpack.prod.js", + "check-strict": "./scripts/ci-check-strict.sh", "dev": "webpack --progress --color --config scripts/webpack/webpack.dev.js", "e2e": "./e2e/start-and-run-suite", "e2e:debug": "./e2e/start-and-run-suite debug", @@ -48,7 +49,7 @@ "typecheck": "tsc --noEmit && yarn run packages:typecheck", "plugins:build-bundled": "grafana-toolkit plugin:bundle-managed", "watch": "yarn start -d watch,start core:start --watchTheme", - "ci:test-frontend": "yarn run prettier:check && yarn run typecheck && yarn run lint && yarn run test:ci && yarn grafana-toolkit node-version-check && ./scripts/ci-check-strict.sh" + "ci:test-frontend": "yarn run test:ci && yarn grafana-toolkit node-version-check" }, "grafana": { "whatsNewUrl": "https://grafana.com/docs/grafana/next/whatsnew/whats-new-in-v8-2/", diff --git a/scripts/drone/pipelines/main.star b/scripts/drone/pipelines/main.star index f99835641f1..24890af3956 100644 --- a/scripts/drone/pipelines/main.star +++ b/scripts/drone/pipelines/main.star @@ -1,6 +1,7 @@ load( 'scripts/drone/steps/lib.star', 'lint_backend_step', + 'lint_frontend_step', 'codespell_step', 'shellcheck_step', 'test_backend_step', @@ -56,6 +57,7 @@ def get_steps(edition, is_downstream=False): codespell_step(), shellcheck_step(), lint_backend_step(edition=edition), + lint_frontend_step(), test_backend_step(edition=edition), test_frontend_step(), build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream), diff --git a/scripts/drone/pipelines/pr.star b/scripts/drone/pipelines/pr.star index 9f741103006..c8f11826248 100644 --- a/scripts/drone/pipelines/pr.star +++ b/scripts/drone/pipelines/pr.star @@ -1,6 +1,7 @@ load( 'scripts/drone/steps/lib.star', 'lint_backend_step', + 'lint_frontend_step', 'codespell_step', 'shellcheck_step', 'build_backend_step', @@ -47,6 +48,7 @@ def pr_pipelines(edition): codespell_step(), shellcheck_step(), lint_backend_step(edition=edition), + lint_frontend_step(), test_backend_step(edition=edition), test_frontend_step(), build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants), diff --git a/scripts/drone/pipelines/release.star b/scripts/drone/pipelines/release.star index d4bf0def159..b975eb97975 100644 --- a/scripts/drone/pipelines/release.star +++ b/scripts/drone/pipelines/release.star @@ -4,6 +4,7 @@ load( 'build_image', 'publish_image', 'lint_backend_step', + 'lint_frontend_step', 'codespell_step', 'shellcheck_step', 'test_backend_step', @@ -83,6 +84,7 @@ def get_steps(edition, ver_mode): codespell_step(), shellcheck_step(), lint_backend_step(edition=edition), + lint_frontend_step(), test_backend_step(edition=edition, tries=tries), test_frontend_step(), build_backend_step(edition=edition, ver_mode=ver_mode), diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index b19b97fd2e0..6431ff5f998 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -391,7 +391,7 @@ def test_frontend_step(): 'name': 'test-frontend', 'image': build_image, 'depends_on': [ - 'lint-backend', + 'lint-frontend', ], 'environment': { 'TEST_MAX_WORKERS': '50%', @@ -401,6 +401,24 @@ def test_frontend_step(): ], } +def lint_frontend_step(): + return { + 'name': 'lint-frontend', + 'image': build_image, + 'depends_on': [ + 'initialize', + ], + 'environment': { + 'TEST_MAX_WORKERS': '50%', + }, + 'commands': [ + 'yarn run prettier:check', + 'yarn run lint', + 'yarn run typecheck', + 'yarn run check-strict', + ], + } + def test_a11y_frontend_step(edition, port=3001): return { 'name': 'test-a11y-frontend' + enterprise2_suffix(edition),