Skip to content

Commit 8910626

Browse files
committed
squashed-into-one-commit
Signed-off-by: Dean Amar <Dean.Amar@ibm.com>
1 parent 24a862b commit 8910626

304 files changed

Lines changed: 59123 additions & 1 deletion

File tree

Some content is hidden

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

.github/pull_request_template.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--
2+
Copyright IBM Corp. All Rights Reserved.
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
6+
DELETE MARKDOWN COMMENTS BEFORE SUBMITTING PULL REQUEST.
7+
8+
If this PR introduces a breaking change that affects compatibility with other components:
9+
- The PR title must begin with the prefix [BREAKING].
10+
- "Breaking change" must be included in the list below.
11+
- Relevant stakeholders must be notified before or immediately after the PR is merged.
12+
-->
13+
#### Type of change
14+
15+
<!--- What type of change? Pick one or more options and delete the others. -->
16+
- Bug fix
17+
- New feature
18+
- Improvement (improvement to code, performance, etc)
19+
- Test update
20+
- Documentation update
21+
- Breaking change
22+
23+
#### Description
24+
25+
<!--- Describe your changes in detail, including motivation. -->
26+
27+
#### Additional details (Optional)
28+
29+
<!--- Additional implementation details or comments to reviewers. -->
30+
<!--- Summarize how the pull request was tested (if not obvious from commit). -->
31+
32+
#### Related issues
33+
34+
<!--- Include a link to any associated Github issue -->

.github/workflows/ci.yml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
name: CI
6+
7+
on:
8+
push:
9+
branches: [ "**" ]
10+
pull_request:
11+
branches: [ "**" ]
12+
13+
env:
14+
DB_DEPLOYMENT: local
15+
16+
jobs:
17+
18+
lint:
19+
name: Lint and Build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-go@v5
24+
with:
25+
go-version-file: go.mod
26+
- run: scripts/install-dev-dependencies.sh
27+
28+
- name: Lint
29+
run: |
30+
# Apply automatic formatting.
31+
gofmt -w .
32+
goimports -local "github.com/hyperledger/fabric-x-committer" -w .
33+
# Re make protobufs, overwriting any formatting
34+
PATH="$HOME/bin:$PATH" make proto
35+
# Check if original code changed due to formatting.
36+
git diff --exit-code
37+
# Fetch main to only show new lint issues.
38+
git fetch -u origin main:main
39+
make lint
40+
41+
- name: Build
42+
run: make build
43+
44+
unit-test:
45+
name: Unit Test (non DB)
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-go@v5
50+
with:
51+
go-version-file: go.mod
52+
- run: scripts/install-dev-dependencies.sh
53+
- run: make test-no-db
54+
55+
fuzz-test:
56+
name: Fuzz Test (non DB)
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: actions/setup-go@v5
61+
with:
62+
go-version-file: go.mod
63+
- run: scripts/install-dev-dependencies.sh
64+
- run: make test-fuzz
65+
66+
db-test:
67+
name: Requires and Core DB Tests (postgres)
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v4
71+
- uses: actions/setup-go@v5
72+
with:
73+
go-version-file: go.mod
74+
- run: scripts/install-dev-dependencies.sh
75+
- run: scripts/get-and-start-postgres.sh
76+
- run: make test-requires-db test-core-db
77+
78+
core-db-test:
79+
name: Core DB Tests (yugabyte)
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: actions/setup-go@v5
84+
with:
85+
go-version-file: go.mod
86+
- run: scripts/install-dev-dependencies.sh
87+
- run: scripts/get-and-start-yuga.sh
88+
- run: make test-core-db
89+
90+
integration-test:
91+
name: Integration Tests (yugabyte)
92+
runs-on: ubuntu-latest
93+
steps:
94+
- uses: actions/checkout@v4
95+
- uses: actions/setup-go@v5
96+
with:
97+
go-version-file: go.mod
98+
- run: scripts/install-dev-dependencies.sh
99+
- run: scripts/get-and-start-yuga.sh
100+
- run: make test-integration
101+
102+
db-resiliency-test:
103+
name: Integration DB Resiliency (container)
104+
runs-on: ubuntu-latest
105+
steps:
106+
- uses: actions/checkout@v4
107+
- uses: actions/setup-go@v5
108+
with:
109+
go-version-file: go.mod
110+
- run: scripts/install-dev-dependencies.sh
111+
- run: make test-integration-db-resiliency
112+
113+
container-test:
114+
name: Build and test all-in-one test image (container)
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: actions/setup-go@v5
119+
with:
120+
go-version-file: go.mod
121+
- run: scripts/install-dev-dependencies.sh
122+
- run: make test-container

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
1+
# Copyright IBM Corp. All Rights Reserved.
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
15
# Binaries for programs and plugins
26
*.exe
37
*.exe~
48
*.dll
59
*.so
610
*.dylib
11+
bin
12+
archbin
713

814
# Test binary, built with `go test -c`
915
*.test
1016

1117
# Output of the go coverage tool, specifically when used with LiteIDE
1218
*.out
1319

20+
# Output of the build and experiment runs
21+
out/
22+
23+
docker/runner/out
24+
1425
# Dependency directories (remove the comment below to include it)
1526
# vendor/
27+
28+
**/generated/**
29+
.idea
30+
.vscode
31+
*coverage.profile
32+
33+
# Log files produced by the tests
34+
test/**/*.log
35+
36+
.DS_Store

0 commit comments

Comments
 (0)