Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ jobs:
go-version: ${{ env.GO_VER }}
- name: Checkout Fabric-Lib-Go Code
uses: actions/checkout@v3
- name: Install SoftHSM
run: scripts/setup_hsm.sh
- name: Run Checks and Unit Tests
run: make checks unit-tests GOTOOLS_BINDIR=${{ env.GOPATH }}/bin
6 changes: 5 additions & 1 deletion scripts/run-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
# SPDX-License-Identifier: Apache-2.0
#

time go test -race -cover ./...
time {
go test -race -cover ./...
go test -race -cover -tags "pkcs11" github.com/hyperledger/fabric-lib-go/bccsp/factory
go test -race -cover -tags "pkcs11" github.com/hyperledger/fabric-lib-go/bccsp/pkcs11
}
12 changes: 12 additions & 0 deletions scripts/setup_hsm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

sudo apt-get install -y softhsm2
sudo mkdir -p /var/lib/softhsm/tokens
sudo softhsm2-util --init-token --slot 0 --label "ForFabric" --so-pin 1234 --pin 98765432
sudo chmod -R 777 /var/lib/softhsm
mkdir -p ~/.config/softhsm2
cp /usr/share/softhsm/softhsm2.conf ~/.config/softhsm2