Skip to content

Commit

Permalink
Move to GitHub Actions (#78)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
  • Loading branch information
Simon Stone authored Mar 4, 2021
1 parent 67a438a commit 5de5680
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 81 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/main.yml
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/')
81 changes: 0 additions & 81 deletions azure-pipelines.yml

This file was deleted.

0 comments on commit 5de5680

Please sign in to comment.