diff --git a/.github/workflows/test-kubectl-plugin-fabric-3.0.yml b/.github/workflows/test-kubectl-plugin-fabric-3.0.yml new file mode 100644 index 00000000..6a8f0552 --- /dev/null +++ b/.github/workflows/test-kubectl-plugin-fabric-3.0.yml @@ -0,0 +1,366 @@ +on: + push: + pull_request: + + +name: Test Kubectl plugin +jobs: + kubectl-hlf: + strategy: + matrix: + go-version: [ 1.23.x ] + os: [ ubuntu-latest ] + runs-on: ${{ matrix.os }} + env: + IMAGE: hlf-operator + TAG: test + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1.4.0 + with: + cluster_name: kind + node_image: kindest/node:v1.25.8 + config: .github/kind-config.yaml + + - name: Install kubectl plugin + run: | + cd kubectl-hlf + go build -o kubectl-hlf ./main.go + sudo mv kubectl-hlf /usr/local/bin/kubectl-hlf + + - name: Install operator CRDs deploy + run: | + go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.4 + make generate manifests install + - name: Deploy the operator + run: | + export GOOS=linux + export GOARCH=amd64 + export CGO_ENABLED=0 + go build -o hlf-operator ./main.go + docker build -t "${IMAGE}:${TAG}" . + kind load docker-image "${IMAGE}:${TAG}" + make deploy IMG="${IMAGE}:${TAG}" + + + - name: Install Istio + run: | + curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.23.2 TARGET_ARCH=x86_64 sh - + export PATH="$PATH:$PWD/istio-1.23.2/bin" + kubectl create namespace istio-system + + istioctl operator init + + + kubectl apply -f - < demo.json + + cat demo.json + - name: Install/Approve/Commit chaincode + run: | + # remove the code.tar.gz asset-transfer-basic-external.tgz if they exist + export CHAINCODE_NAME=asset + export CHAINCODE_LABEL=asset + cat << METADATA-EOF > "metadata.json" + { + "type": "ccaas", + "label": "${CHAINCODE_LABEL}" + } + METADATA-EOF + + cat > "connection.json" <