Skip to content

Commit

Permalink
move CI to github actions
Browse files Browse the repository at this point in the history
Change-Id: Ia10e5a2c0a6b808558c88c0b4d4767a677d6fe8f
Signed-off-by: Yacov Manevich <[email protected]>
  • Loading branch information
yacovm committed Feb 1, 2021
1 parent 6d4558e commit 98577f5
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 48 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/Parallel_UTs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Parallel_UTs

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the release-1.4-BFT-3 branch
push:
branches: [ release-1.4-BFT-4 ]
pull_request:
branches: [ release-1.4-BFT-4 ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
parallel_UTs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14.12

- name: Prepare Env
run: bash ./scripts/prepare_environ.sh

# Runs a single command using the runners shell
- name: Checks
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./unit-test/run.sh parallel

- name: Post
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./scripts/post.sh

40 changes: 40 additions & 0 deletions .github/workflows/Preliminary_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Preliminary_checks

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the release-1.4-BFT-3 branch
push:
branches: [ release-1.4-BFT-4 ]
pull_request:
branches: [ release-1.4-BFT-4 ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Preliminary_checks:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14.12

- name: Prepare Env
run: bash ./scripts/prepare_environ.sh

# Runs a single command using the runners shell
- name: Checks
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./scripts/build_checks.sh

- name: Post
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./scripts/post.sh
40 changes: 40 additions & 0 deletions .github/workflows/Serial_UTs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This is a basic workflow to help you get started with Actions

name: Serial_UTs

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the release-1.4-BFT-3 branch
push:
branches: [ release-1.4-BFT-4 ]
pull_request:
branches: [ release-1.4-BFT-4 ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Serial_UTs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14.12

- name: Prepare Env
run: bash ./scripts/prepare_environ.sh

# Runs a single command using the runners shell
- name: Checks
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./unit-test/run.sh serial

- name: Post
working-directory: /home/runner/go/src/github.com/hyperledger/fabric
run: bash ./scripts/post.sh
48 changes: 0 additions & 48 deletions .github/workflows/trigger.yml

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/build_checks.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/usr/bin/env bash -xe


export GOROOT=$(go env GOROOT)
export GOPATH=$(go env GOPATH)

go get -u golang.org/x/tools/cmd/goimports

bash ./scripts/golinter.sh
Expand Down
5 changes: 5 additions & 0 deletions scripts/post.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

export GOPATH=$(go env GOPATH)
cd ..
mv fabric /home/runner/work/fabric/
12 changes: 12 additions & 0 deletions scripts/prepare_environ.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -x


export GOROOT=$(go env GOROOT)
export GOPATH=$(go env GOPATH)
mkdir -p $GOPATH/src/github.com/hyperledger/
cd ..
echo "[[[[" `pwd` "]]]]"
mv fabric $GOPATH/src/github.com/hyperledger/
cd $GOPATH/src/github.com/hyperledger/fabric


2 changes: 2 additions & 0 deletions unit-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

type=$1

export GOROOT=$(go env GOROOT)
export GOPATH=$(go env GOPATH)

make docker

Expand Down

0 comments on commit 98577f5

Please sign in to comment.