Skip to content

Commit 02f9b16

Browse files
Refactor makefile and gh actions
- cleanup / update gh actions - cleanup makefile - move some integration tests to adress changes in makefile Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
1 parent c44a2af commit 02f9b16

38 files changed

+207
-280
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ jobs:
2020
contents: read
2121

2222
steps:
23-
- name: Checkout repository
24-
uses: actions/checkout@v4
25-
23+
- uses: actions/checkout@v5
2624
- name: Initialize CodeQL
2725
uses: github/codeql-action/init@v3
2826
with:
@@ -34,7 +32,7 @@ jobs:
3432
run: |
3533
go build -o fsccli ./cmd/fsccli
3634
go build -o node ./ci/codeql/node
37-
make download-fabric unit-tests
35+
make download-fabric-bins unit-tests
3836
3937
- name: Perform CodeQL Analysis
4038
uses: github/codeql-action/analyze@v3

.github/workflows/git.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v5
1111
- name: Block Fixup Commit Merge
12-
uses: 13rac1/block-fixup-merge-action@v2.0.0
12+
uses: 13rac1/block-fixup-merge-action@v2.0.0

.github/workflows/golangci-lint.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,23 @@ name: golangci-lint
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- main
5+
branches: [ main ]
86
pull_request:
9-
# The branches below must be a subset of the branches above
107
branches: [ main ]
118

129
permissions:
1310
contents: read
14-
# Optional: allow read access to pull request. Use with `only-new-issues` option.
15-
# pull-requests: read
1611

1712
jobs:
1813
golangci:
19-
name: lint
2014
runs-on: ubuntu-latest
2115
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-go@v5
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-go@v6
2418
with:
2519
go-version-file: "go.mod"
26-
cache: false
2720
- name: golangci-lint
28-
uses: golangci/golangci-lint-action@v7
21+
uses: golangci/golangci-lint-action@v8
2922
with:
30-
version: v2.0
31-
args: --timeout=30m
23+
version: v2.4
24+
args: --timeout=5m

.github/workflows/tests.yml

Lines changed: 30 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,97 +8,70 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
1211
checks:
1312
runs-on: ubuntu-latest
14-
1513
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
19-
- name: Set up Go
20-
uses: actions/setup-go@v5
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-go@v6
2116
with:
2217
go-version-file: "go.mod"
2318
cache-dependency-path: "**/*.sum"
24-
25-
- name: Set up tools
26-
run: make install-tools
27-
28-
- name: Run checks
29-
run: make checks
19+
- run: make install-tools
20+
- run: make checks
3021

3122
utest:
3223
needs: checks
3324
runs-on: ubuntu-latest
3425
strategy:
3526
matrix:
3627
tests: [unit-tests-race]
37-
3828
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v4
41-
42-
- name: Set up Go
43-
uses: actions/setup-go@v5
29+
- uses: actions/checkout@v5
30+
- uses: actions/setup-go@v6
4431
with:
4532
go-version-file: "go.mod"
4633
cache-dependency-path: "**/*.sum"
34+
- run: make install-tools
35+
- run: make download-fabric-bins
36+
- run: make ${{ matrix.tests }}
4737

48-
- name: Set up tools
49-
run: make install-tools
50-
51-
- name: Download fabric binaries
52-
run: make download-fabric
53-
54-
- name: Run ${{ matrix.tests }}
55-
run: make ${{ matrix.tests }}
38+
define-itest:
39+
runs-on: ubuntu-latest
40+
outputs:
41+
targets: ${{ steps.targets.outputs.targets }}
42+
steps:
43+
- name: list itest targets
44+
id: targets
45+
run: |
46+
make list-integration-tests >> "$GITHUB_OUTPUT"
5647
5748
itest:
58-
needs: checks
49+
needs:
50+
- checks
51+
- define-itest
5952
runs-on: ubuntu-latest
6053
strategy:
6154
fail-fast: false
6255
matrix:
63-
tests: [
64-
atsacc,
65-
fabric-stoprestart,
66-
atsafsc,
67-
iou,
68-
iou-hsm,
69-
pingpong,
70-
stoprestart,
71-
twonets,
72-
chaincode-events,
73-
fabricx-iou
74-
]
75-
56+
# run all test as listed via `make list-integration-tests`
57+
tests: ${{ needs.define-itest.outputs.targets }}
7658
steps:
77-
- name: Checkout code
78-
uses: actions/checkout@v4
79-
80-
- name: Set up Go
81-
uses: actions/setup-go@v5
59+
- uses: actions/checkout@v5
60+
- uses: actions/setup-go@v6
8261
with:
8362
go-version-file: "go.mod"
8463
cache-dependency-path: "**/*.sum"
85-
86-
- name: Set up tools
87-
run: make install-tools
88-
89-
- name: Download fabric binaries
90-
run: make download-fabric
91-
92-
- name: Docker
93-
run: make docker-images
64+
- run: make install-tools
65+
- run: make download-fabric-bins
66+
- run: make docker-images
9467

9568
- name: Set up softhsm
69+
if: endsWith(matrix.tests, 'hsm')
9670
run: make install-softhsm
9771

9872
- name: Fabric-x setup
9973
if: startsWith(matrix.tests, 'fabricx')
10074
run: |
10175
make fxconfig configtxgen fabricx-docker-images
10276
103-
- name: Run ${{ matrix.tests }}
104-
run: make integration-tests-${{ matrix.tests }}
77+
- run: make integration-tests-${{ matrix.tests }}

0 commit comments

Comments
 (0)