Add VSCode tasks example and documentation #74
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# SPDX-License-Identifier: Apache-2.0 | |
# | |
--- | |
name: Pull Request | |
on: | |
pull_request: | |
workflow_dispatch: {} | |
jobs: | |
# Lint, Compile and Core Function Tests | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use Go 1.18 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Run Go formatters and linters | |
run: make lint | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Use Node.js 20 | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- name: Install Fabric dependencies | |
run: | | |
sudo mkdir -p /opt/fabric | |
pushd /opt/fabric | |
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary --fabric-version 2.5.0-alpha3 --ca-version 1.5.6-beta3 | |
popd | |
cd builders/java | |
sudo mvn -q dependency:copy-dependencies -DoutputDirectory=/opt/fabric-chaincode-java/lib | |
npm install -g fabric-shim@2.5.1 | |
- name: Run Go formatters and linters | |
run: make lint | |
- name: Run Go unit tests | |
run: make unit | |
- name: Run Go integration tests | |
run: | | |
export PATH="/opt/fabric/bin:${PATH}" | |
export FABRIC_CFG_PATH=/opt/fabric/config | |
make integration | |
- name: Run ShellCheck | |
run: shellcheck $(ls builders/*/bin/* -1 | grep -v ccaas) | |
fvt: | |
name: Functional Tests | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Setup Fabric | |
run: | | |
curl -sSL https://raw.githubusercontent.com/hyperledger/fabric/main/scripts/install-fabric.sh | bash -s -- binary | |
# set the path and cfg env var for the rest of the step | |
echo "FABRIC_CFG_PATH=$GITHUB_WORKSPACE/config" >> $GITHUB_ENV | |
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH | |
- name: Build Docker image | |
id: dockerbuild | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
file: Dockerfile2 | |
platforms: linux/amd64 | |
push: false | |
load: true | |
tags: dev-microfab | |
- name: Run against image | |
run: | | |
docker images | |
./scripts/test-container.sh | |
env: | |
MICROFAB_IMAGE: dev-microfab | |