Skip to content

Commit

Permalink
Github Actions Verify Build
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Castrence <juliancastrence@ibm.com>
(cherry picked from commit cdda524)
  • Loading branch information
jrc-ibm authored and denyeart committed Aug 23, 2022
1 parent bcc7758 commit d4f490c
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 6 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Copyright the Hyperledger Fabric contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

name: Verify Build
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
workflow_dispatch:

env:
GOPATH: /opt/go
PATH: /opt/go/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GO_VER: 1.18.2

jobs:
basic-checks:
name: Basic Checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: make basic-checks
name: Run Basic Checks
unit-tests:
name: Unit Tests
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make unit-test
name: Run Unit Tests
integration-tests-1:
name: Integration Tests 1
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="configtx gossip raft"
name: Run Integration Tests 1
integration-tests-2:
name: Integration Tests 2
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="idemix devmode nwo pvtdata"
name: Run Integration Tests 2
integration-tests-3:
name: Integration Tests 3
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="configtxlator pkcs11 pluggable sbe msp discovery"
name: Run Integration Tests 3
integration-tests-4:
name: Integration Tests 4
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="e2e ledger"
name: Run Integration Tests 4
integration-tests-5:
name: Integration Tests 5
needs: basic-checks
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v3
name: Install Go
with:
go-version: ${{ env.GO_VER }}
- uses: actions/checkout@v3
name: Checkout Fabric Code
- run: ci/scripts/setup_hsm.sh
name: Install SoftHSM
- run: make integration-test INTEGRATION_TEST_SUITE="gateway lifecycle"
name: Run Integration Tests 5
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ check-go-version:

.PHONY: integration-test
integration-test: integration-test-prereqs
./scripts/run-integration-tests.sh
./scripts/run-integration-tests.sh $(INTEGRATION_TEST_SUITE)

.PHONY: integration-test-prereqs
integration-test-prereqs: gotool.ginkgo baseos-docker ccenv-docker docker-thirdparty
Expand Down
File renamed without changes.
15 changes: 10 additions & 5 deletions scripts/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ fabric_dir="$(cd "$(dirname "$0")/.." && pwd)"
cd "$fabric_dir"

declare -a test_dirs
while IFS='' read -r line; do test_dirs+=("$line"); done < <(
go list -f '{{ if or (len .TestGoFiles | ne 0) (len .XTestGoFiles | ne 0) }}{{ println .Dir }}{{ end }}' ./... | \
grep integration | \
sed s,"${fabric_dir}",.,g
)
if [ $# -eq 0 ]
then
while IFS='' read -r line; do test_dirs+=("$line"); done < <(
go list -f '{{ if or (len .TestGoFiles | ne 0) (len .XTestGoFiles | ne 0) }}{{ println .Dir }}{{ end }}' ./... | \
grep integration | \
sed s,"${fabric_dir}",.,g
)
else
for arg in "$@"; do test_dirs+=("./integration/$arg"); done
fi

total_agents=${SYSTEM_TOTALJOBSINPHASE:-1} # standard VSTS variables available using parallel execution; total number of parallel jobs running
agent_number=${SYSTEM_JOBPOSITIONINPHASE:-1} # current job position
Expand Down

0 comments on commit d4f490c

Please sign in to comment.