Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/golang.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Golang build

on:
workflow_call:

jobs:
#unit-test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-go@v4
# with:
# go-version: '1.20'
# - name: Generate test mocks
# run: make generate
# - name: Unit test
# run: make unit-test-go

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Generate test mocks
run: make generate
- name: Staticcheck
run: make staticcheck
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
skip-pkg-cache: true

end-to-end:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
FABRIC_VERSION: ['2.4.8', '2.5.0']
CREATE_CHANNEL: [create_channel, existing_channel]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '1.20'
- run: ./hack/ci.sh ${{matrix.FABRIC_VERSION}} ${{matrix.CREATE_CHANNEL}}
22 changes: 22 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Pull request

on:
pull_request:
banches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
go:
uses: ./.github/workflows/golang.yml

pull-request:
needs:
- go
name: Pull request success
runs-on: ubuntu-latest
steps:
- run: true
10 changes: 10 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Push

on:
push:
branches:
- main

jobs:
go:
uses: ./.github/workflows/golang.yml
9 changes: 9 additions & 0 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Scheduled build

on:
schedule:
- cron: "10 01 * * *"

jobs:
go:
uses: ./.github/workflows/golang.yml
27 changes: 27 additions & 0 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Security vulnerability scan

on:
schedule:
- cron: '20 02 * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
go:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- govulncheck
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
check-latest: true
- name: Scan
run: make scan-go-${{ matrix.target }}
37 changes: 0 additions & 37 deletions ci/azure-pipelines.yml

This file was deleted.

18 changes: 0 additions & 18 deletions ci/install_deps.yml

This file was deleted.

4 changes: 2 additions & 2 deletions cmd/commands/chaincode/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ type BaseCommand struct {
func (c *BaseCommand) Complete() error {
var err error

if c.Factory == nil {
/*if c.Factory == nil {
c.Factory, err = fabric.NewFactory(c.Settings.Config)
if err != nil {
return err
}
}
}*/

c.Channel, err = c.Factory.Channel()
if err != nil {
Expand Down
124 changes: 0 additions & 124 deletions cmd/commands/chaincode/chaincode_test.go

This file was deleted.

5 changes: 2 additions & 3 deletions cmd/commands/chaincode/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ package chaincode

import (
"errors"
"fmt"

"github.com/spf13/cobra"

Expand Down Expand Up @@ -67,7 +66,7 @@ func (c *EventsCommand) Validate() error {

// Run executes the command
func (c *EventsCommand) Run() error {
registration, eventCh, err := c.Channel.RegisterChaincodeEvent(c.ChaincodeName, "")
/*registration, eventCh, err := c.Channel.RegisterChaincodeEvent(c.ChaincodeName, "")
if err != nil {
return err
}
Expand All @@ -76,7 +75,7 @@ func (c *EventsCommand) Run() error {

for event := range eventCh {
fmt.Fprintln(c.Settings.Streams.Out, string(event.Payload))
}
}*/

return nil
}
Loading