Build pipeline: Cleanup PR pipeline steps (#38447)

* Refactor dependencies

* Regenerate drone.yml

* Reorder steps in starlark files

* Make build depend on test

* Make test steps depend on lint

* Make gen-version step depend on build steps
This commit is contained in:
Dimitris Sotirakis
2021-08-24 17:07:06 +02:00
committed by GitHub
parent 8bb9600cc6
commit e8faa2c900
6 changed files with 129 additions and 227 deletions
+4 -13
View File
@@ -223,7 +223,6 @@ def lint_backend_step(edition):
},
'depends_on': [
'initialize',
'test-backend' + enterprise2_sfx(edition),
],
'commands': [
# Don't use Make since it will re-download the linters
@@ -368,8 +367,6 @@ def build_backend_step(edition, ver_mode, variants=None, is_downstream=False):
'name': 'build-backend' + enterprise2_sfx(edition),
'image': build_image,
'depends_on': [
'initialize',
'lint-backend' + enterprise2_sfx(edition),
'test-backend' + enterprise2_sfx(edition),
],
'environment': env,
@@ -403,7 +400,6 @@ def build_frontend_step(edition, ver_mode, is_downstream=False):
'name': 'build-frontend',
'image': build_image,
'depends_on': [
'initialize',
'test-frontend',
],
'commands': cmds,
@@ -434,7 +430,6 @@ def build_plugins_step(edition, sign=False):
'name': 'build-plugins',
'image': build_image,
'depends_on': [
'initialize',
'lint-backend',
],
'environment': env,
@@ -454,7 +449,7 @@ def test_backend_step(edition, tries=None):
'name': 'test-backend' + enterprise2_sfx(edition),
'image': build_image,
'depends_on': [
'initialize',
'lint-backend',
],
'commands': [
# First make sure that there are no tests with FocusConvey
@@ -471,7 +466,7 @@ def test_frontend_step():
'name': 'test-frontend',
'image': build_image,
'depends_on': [
'initialize',
'lint-backend',
],
'environment': {
'TEST_MAX_WORKERS': '50%',
@@ -547,11 +542,9 @@ def shellcheck_step():
def gen_version_step(ver_mode, include_enterprise2=False, is_downstream=False):
deps = [
'build-plugins',
'build-backend',
'build-frontend',
'build-plugins',
'test-backend',
'test-frontend',
'codespell',
'shellcheck',
]
@@ -694,7 +687,6 @@ def build_docs_website_step():
# Use latest revision here, since we want to catch if it breaks
'image': 'grafana/docs-base:latest',
'depends_on': [
'initialize',
'build-frontend-docs',
],
'commands': [
@@ -709,7 +701,6 @@ def copy_packages_for_docker_step():
'name': 'copy-packages-for-docker',
'image': build_image,
'depends_on': [
'package',
'end-to-end-tests-server',
],
'commands': [
@@ -740,7 +731,7 @@ def build_docker_images_step(edition, ver_mode, archs=None, ubuntu=False, publis
return {
'name': 'build-docker-images' + ubuntu_sfx,
'image': grafana_docker_image,
'depends_on': ['copy-packages-for-docker', 'end-to-end-tests-server'],
'depends_on': ['copy-packages-for-docker'],
'settings': settings,
}
+2 -2
View File
@@ -47,8 +47,8 @@ def get_steps(edition, is_downstream=False):
enterprise_downstream_step(edition=edition),
codespell_step(),
shellcheck_step(),
test_backend_step(edition=edition),
lint_backend_step(edition=edition),
test_backend_step(edition=edition),
test_frontend_step(),
build_backend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
build_frontend_step(edition=edition, ver_mode=ver_mode, is_downstream=is_downstream),
@@ -60,8 +60,8 @@ def get_steps(edition, is_downstream=False):
if include_enterprise2:
edition2 = 'enterprise2'
steps.extend([
test_backend_step(edition=edition2),
lint_backend_step(edition=edition2),
test_backend_step(edition=edition2),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64'], is_downstream=is_downstream),
])
+4 -4
View File
@@ -4,11 +4,11 @@ load(
'lint_backend_step',
'codespell_step',
'shellcheck_step',
'test_backend_step',
'test_frontend_step',
'build_backend_step',
'build_frontend_step',
'build_plugins_step',
'test_backend_step',
'test_frontend_step',
'gen_version_step',
'package_step',
'e2e_tests_server_step',
@@ -37,8 +37,8 @@ def pr_pipelines(edition):
steps = [
codespell_step(),
shellcheck_step(),
test_backend_step(edition=edition),
lint_backend_step(edition=edition),
test_backend_step(edition=edition),
test_frontend_step(),
build_backend_step(edition=edition, ver_mode=ver_mode, variants=variants),
build_frontend_step(edition=edition, ver_mode=ver_mode),
@@ -52,8 +52,8 @@ def pr_pipelines(edition):
steps.append(benchmark_ldap_step())
services.append(ldap_service())
steps.extend([
test_backend_step(edition=edition2),
lint_backend_step(edition=edition2),
test_backend_step(edition=edition2),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
])
+2 -2
View File
@@ -74,8 +74,8 @@ def get_steps(edition, ver_mode):
steps = [
codespell_step(),
shellcheck_step(),
test_backend_step(edition=edition, tries=tries),
lint_backend_step(edition=edition),
test_backend_step(edition=edition, tries=tries),
test_frontend_step(),
build_backend_step(edition=edition, ver_mode=ver_mode),
build_frontend_step(edition=edition, ver_mode=ver_mode),
@@ -87,8 +87,8 @@ def get_steps(edition, ver_mode):
if include_enterprise2:
edition2 = 'enterprise2'
steps.extend([
test_backend_step(edition=edition2, tries=tries),
lint_backend_step(edition=edition2),
test_backend_step(edition=edition2, tries=tries),
build_backend_step(edition=edition2, ver_mode=ver_mode, variants=['linux-x64']),
])