Skip to content

Commit e2dbc98

Browse files
committed
ci: test supported node versions
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 5175252 commit e2dbc98

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ on:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
node_version:
22+
- 20
23+
- 18
1824
steps:
1925
-
2026
name: Checkout
@@ -24,3 +30,5 @@ jobs:
2430
uses: docker/bake-action@v5
2531
with:
2632
targets: build
33+
env:
34+
NODE_VERSION: ${{ matrix.node_version }}

.github/workflows/test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ env:
2121
jobs:
2222
test:
2323
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
node_version:
28+
- 20
29+
- 18
2430
steps:
2531
-
2632
name: Checkout
@@ -32,6 +38,7 @@ jobs:
3238
targets: test-coverage
3339
env:
3440
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
NODE_VERSION: ${{ matrix.node_version }}
3542
-
3643
name: Check coverage
3744
run: |
@@ -44,7 +51,7 @@ jobs:
4451
-
4552
name: Upload coverage
4653
uses: codecov/codecov-action@v5
47-
if: env.RUN_CODECOV == 'true'
54+
if: env.RUN_CODECOV == 'true' && matrix.node_version == env.NODE_VERSION
4855
with:
4956
files: ./coverage/clover.xml
5057
flags: unit

docker-bake.hcl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
variable "NODE_VERSION" {
16+
default = null
17+
}
18+
1519
group "default" {
1620
targets = ["build"]
1721
}
@@ -24,31 +28,42 @@ group "validate" {
2428
targets = ["lint", "vendor-validate", "dockerfile-validate", "license-validate"]
2529
}
2630

31+
target "_common" {
32+
args = {
33+
NODE_VERSION = NODE_VERSION
34+
}
35+
}
36+
2737
target "build" {
38+
inherits = ["_common"]
2839
dockerfile = "dev.Dockerfile"
2940
target = "build-update"
3041
output = ["."]
3142
}
3243

3344
target "format" {
45+
inherits = ["_common"]
3446
dockerfile = "dev.Dockerfile"
3547
target = "format-update"
3648
output = ["."]
3749
}
3850

3951
target "lint" {
52+
inherits = ["_common"]
4053
dockerfile = "dev.Dockerfile"
4154
target = "lint"
4255
output = ["type=cacheonly"]
4356
}
4457

4558
target "vendor" {
59+
inherits = ["_common"]
4660
dockerfile = "dev.Dockerfile"
4761
target = "vendor-update"
4862
output = ["."]
4963
}
5064

5165
target "vendor-validate" {
66+
inherits = ["_common"]
5267
dockerfile = "dev.Dockerfile"
5368
target = "vendor-validate"
5469
output = ["type=cacheonly"]
@@ -67,13 +82,15 @@ target "dockerfile-validate" {
6782
}
6883

6984
target "test" {
85+
inherits = ["_common"]
7086
dockerfile = "dev.Dockerfile"
7187
target = "test"
7288
output = ["type=cacheonly"]
7389
secret = ["id=GITHUB_TOKEN,env=GITHUB_TOKEN"]
7490
}
7591

7692
target "test-coverage" {
93+
inherits = ["_common"]
7794
dockerfile = "dev.Dockerfile"
7895
target = "test-coverage"
7996
output = ["./coverage"]
@@ -87,6 +104,7 @@ variable "GITHUB_REF" {
87104
}
88105

89106
target "publish" {
107+
inherits = ["_common"]
90108
dockerfile = "dev.Dockerfile"
91109
args = {
92110
GITHUB_REF = GITHUB_REF

0 commit comments

Comments
 (0)