-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
- Loading branch information
Simon Stone
authored
Mar 4, 2021
1 parent
67a438a
commit 5de5680
Showing
2 changed files
with
72 additions
and
81 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
|
||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
--- | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: "0 0 * * *" | ||
create: | ||
tags: | ||
- "*" | ||
workflow_dispatch: {} | ||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Use Go 1.14 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.14 | ||
- name: Use Java 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Use Node.js 12 | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 12 | ||
- name: Install Fabric dependencies | ||
run: | | ||
sudo mkdir -p /opt/fabric | ||
curl -sSL https://github.com/hyperledger/fabric/releases/download/v2.2.2/hyperledger-fabric-linux-amd64-2.2.2.tar.gz | sudo tar xzf - -C /opt/fabric | ||
curl -sSL https://github.com/hyperledger/fabric-ca/releases/download/v1.4.9/hyperledger-fabric-ca-linux-amd64-1.4.9.tar.gz | sudo tar xzf - -C /opt/fabric | ||
cd builders/java | ||
sudo mvn -q dependency:copy-dependencies -DoutputDirectory=/opt/fabric-chaincode-java/lib | ||
npm install -g fabric-shim@2.2.0 | ||
- 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 builders/*/bin/* | ||
- name: Build Docker image | ||
run: | | ||
VERSION=$(git describe --exact-match --tags $(Build.SourceVersion) | sed 's/^v//') | ||
docker build -t ibmcom/ibp-microfab:${VERSION} . | ||
docker tag ibmcom/ibp-microfab:${VERSION} ibmcom/ibp-microfab:latest | ||
- name: Publish Docker image to Docker Hub | ||
env: | ||
DOCKER_HUB_USER_NAME: ${{ secrets.DOCKER_HUB_USER_NAME }} | ||
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | ||
run: | | ||
VERSION=$(git describe --exact-match --tags $(Build.SourceVersion) | sed 's/^v//') | ||
docker login -u ${DOCKER_HUB_USER_NAME} -p ${DOCKER_HUB_ACCESS_TOKEN} | ||
docker push ibmcom/ibp-microfab:${VERSION} | ||
docker push ibmcom/ibp-microfab:latest | ||
if: startsWith(github.ref, 'refs/tags/') |
This file was deleted.
Oops, something went wrong.