Skip to content

Commit e9dbfe2

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 10fd368 commit e9dbfe2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+451
-495
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,22 @@ 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:
2927
languages: go
3028
build-mode: manual
3129

30+
- run: make install-fabric-bins
31+
- run: make testing-docker-images
32+
3233
- name: Build manually
3334
shell: bash
3435
run: |
3536
go build -o fsccli ./cmd/fsccli
3637
go build -o node ./ci/codeql/node
37-
make download-fabric unit-tests
38+
make unit-tests
3839
3940
- name: Perform CodeQL Analysis
4041
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: 42 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -8,97 +8,73 @@ 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:
32-
needs: checks
23+
needs:
24+
- checks
3325
runs-on: ubuntu-latest
34-
strategy:
35-
matrix:
36-
tests: [unit-tests-race]
37-
3826
steps:
39-
- name: Checkout code
40-
uses: actions/checkout@v4
41-
42-
- name: Set up Go
43-
uses: actions/setup-go@v5
27+
- uses: actions/checkout@v5
28+
- uses: actions/setup-go@v6
4429
with:
4530
go-version-file: "go.mod"
4631
cache-dependency-path: "**/*.sum"
32+
- run: make install-tools
33+
- run: make install-fabric-bins
34+
- run: make testing-docker-images
35+
- run: make unit-tests-race
4736

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 }}
37+
itest-list:
38+
runs-on: ubuntu-latest
39+
outputs:
40+
tests: ${{ steps.set-itest-tests.outputs.tests }}
41+
steps:
42+
- uses: actions/checkout@v5
43+
- name: list itest targets
44+
id: set-itest-tests
45+
run: |
46+
echo "tests=$(make list-integration-tests | jq -R . | jq -s -c .)" >> $GITHUB_OUTPUT
5647
5748
itest:
58-
needs: checks
49+
needs:
50+
- checks
51+
- itest-list
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: ${{ fromJson(needs.itest-list.outputs.tests) }}
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"
64+
- run: make install-tools
65+
- run: make install-fabric-bins
66+
- run: make docker-images
8567

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
94-
95-
- name: Set up softhsm
96-
run: make install-softhsm
97-
98-
- name: Fabric-x setup
68+
- name: Set up Fabric-x
9969
if: startsWith(matrix.tests, 'fabricx')
10070
run: |
101-
make fxconfig configtxgen fabricx-docker-images
71+
make install-fxconfig install-configtxgen fabricx-docker-images
72+
73+
- name: Set up Softhsm
74+
# we only need this for a subset of integration tests
75+
if: endsWith(matrix.tests, 'hsm')
76+
run: |
77+
make install-softhsm
78+
./ci/scripts/setup_softhsm.sh
10279
103-
- name: Run ${{ matrix.tests }}
104-
run: make integration-tests-${{ matrix.tests }}
80+
- run: make integration-tests-${{ matrix.tests }}

0 commit comments

Comments
 (0)