Skip to content

Commit 2b5c35b

Browse files
chore: do cargo fmt, check, and clippy only once
1 parent b521753 commit 2b5c35b

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

.gitlab/datasources/flavors.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ flavors:
33
arch: amd64
44
alpine: 0
55
fips: 0
6-
needs_code_checks: true
76
needs_layer_publish: true
87
suffix: amd64
98
layer_name_base_suffix: ""
@@ -14,7 +13,6 @@ flavors:
1413
arch: arm64
1514
alpine: 0
1615
fips: 0
17-
needs_code_checks: true
1816
needs_layer_publish: true
1917
suffix: arm64
2018
layer_name_base_suffix: "-ARM"
@@ -25,23 +23,20 @@ flavors:
2523
arch: amd64
2624
alpine: 1
2725
fips: 0
28-
needs_code_checks: false
2926
needs_layer_publish: false
3027
suffix: amd64-alpine
3128

3229
- name: arm64, alpine
3330
arch: arm64
3431
alpine: 1
3532
fips: 0
36-
needs_code_checks: false
3733
needs_layer_publish: false
3834
suffix: arm64-alpine
3935

4036
- name: amd64, fips
4137
arch: amd64
4238
alpine: 0
4339
fips: 1
44-
needs_code_checks: false
4540
needs_layer_publish: true
4641
suffix: amd64-fips
4742
layer_name_base_suffix: "-FIPS"
@@ -52,7 +47,6 @@ flavors:
5247
arch: arm64
5348
alpine: 0
5449
fips: 1
55-
needs_code_checks: false
5650
needs_layer_publish: true
5751
suffix: arm64-fips
5852
layer_name_base_suffix: "-FIPS-ARM"
@@ -63,15 +57,13 @@ flavors:
6357
arch: amd64
6458
alpine: 1
6559
fips: 1
66-
needs_code_checks: false
6760
needs_layer_publish: false
6861
suffix: amd64-fips-alpine
6962

7063
- name: arm64, fips, alpine
7164
arch: arm64
7265
alpine: 1
7366
fips: 1
74-
needs_code_checks: false
7567
needs_layer_publish: false
7668
suffix: arm64-fips-alpine
7769

.gitlab/templates/pipeline.yaml.tpl

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,31 @@ variables:
1616
CI_DOCKER_TARGET_IMAGE: registry.ddbuild.io/ci/datadog-lambda-extension
1717
CI_DOCKER_TARGET_VERSION: latest
1818

19-
{{ range $flavor := (ds "flavors").flavors }}
20-
21-
{{ if $flavor.needs_code_checks }}
22-
23-
cargo fmt ({{ $flavor.arch }}):
19+
cargo fmt:
2420
stage: test
25-
tags: ["arch:{{ $flavor.arch }}"]
21+
tags: ["arch:amd64"]
2622
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
2723
needs: []
2824
script:
2925
- cd bottlecap && cargo fmt
3026

31-
cargo check ({{ $flavor.arch }}):
27+
cargo check:
3228
stage: test
33-
tags: ["arch:{{ $flavor.arch }}"]
29+
tags: ["arch:amd64"]
3430
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
3531
needs: []
3632
script:
3733
- cd bottlecap && cargo check
3834

39-
cargo clippy ({{ $flavor.arch }}):
35+
cargo clippy:
4036
stage: test
41-
tags: ["arch:{{ $flavor.arch }}"]
37+
tags: ["arch:amd64"]
4238
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
4339
needs: []
4440
script:
4541
- cd bottlecap && cargo clippy --all-features
4642

47-
{{ end }} # end needs_code_checks
43+
{{ range $flavor := (ds "flavors").flavors }}
4844

4945
go agent ({{ $flavor.name }}):
5046
stage: compile
@@ -92,9 +88,9 @@ layer ({{ $flavor.name }}):
9288
needs:
9389
- go agent ({{ $flavor.name }})
9490
- bottlecap ({{ $flavor.name }})
95-
- cargo fmt ({{ $flavor.arch }})
96-
- cargo check ({{ $flavor.arch }})
97-
- cargo clippy ({{ $flavor.arch }})
91+
- cargo fmt
92+
- cargo check
93+
- cargo clippy
9894
dependencies:
9995
- go agent ({{ $flavor.name }})
10096
- bottlecap ({{ $flavor.name }})

0 commit comments

Comments
 (0)