From 98ef35aec487b01c651fa127b21c431d1ab8487f Mon Sep 17 00:00:00 2001 From: Anvith KS Date: Sat, 8 May 2021 11:27:00 +0530 Subject: [PATCH 1/3] Added the workflow file for GitHub Actions CI --- .github/workflows/ci.yml | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..2a20d82c2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,60 @@ +name: SODA API CI Build + +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + env: + GO111MODULE: on + TARGET: amd64 + + strategy: + matrix: + go-version: [1.12.x, 1.13.x] + os: [ubuntu-16.04] + + runs-on: ${{ matrix.os }} + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout project + uses: actions/checkout@v2 + + - name: Symlink source into GOPATH for api + run: | + mkdir -p $(go env GOPATH)/src/github.com/sodafoundation/api + sudo ln -s $(pwd) $(go env GOPATH)/src/github.com/sodafoundation/api + + - name: Create the Folder structure and symlink to opensds (TODO:-Fix vendor module from opensds to sodafoundation) + run: | + echo "Check current dir: \n" + pwd + echo "GOPATH: $(go env GOPATH)" + sudo mkdir -p $(go env GOPATH)/src/github.com/opensds + sudo ln -s $(go env GOPATH)/src/github.com/sodafoundation $(go env GOPATH)/src/github.com/opensds + + - name: Install Pre-requisites + run: | + sudo apt-get update + sudo apt-get install -y build-essential gcc + sudo apt-get install -y librados-dev librbd-dev + sudo apt-get install -y lvm2 tgt open-iscsi + sudo docker pull p1c2u/openapi-spec-validator + + - name: Build the binaries + run: | + make osdsapiserver + make osdsctl + + - name: Run CI scripts for Testing + run: ./install/CI/coverage && ./install/CI/test + + - name: After success run Codecov Coverage tool. + uses: codecov/codecov-action@v1 + + - name: Clean up the build + run: | + make clean From 5cf0d366380e22b5fe1fcd9f82e42b388eb32f55 Mon Sep 17 00:00:00 2001 From: Anvith KS Date: Sat, 8 May 2021 12:03:03 +0530 Subject: [PATCH 2/3] Added the build status badge to readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4ffc5f288..b2771f219 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # SODA API [![Go Report Card](https://goreportcard.com/badge/github.com/sodafoundation/api?branch=master)](https://goreportcard.com/report/github.com/sodafoundation/api) -[![Build Status](https://travis-ci.org/sodafoundation/api.svg?branch=master)](https://travis-ci.org/sodafoundation/api) +[![Build Status](https://github.com/sodafoundation/api/actions/workflows/ci.yml/badge.svg)](https://github.com/sodafoundation/api/actions/workflows/ci.yml) [![codecov.io](https://codecov.io/github/sodafoundation/api/coverage.svg?branch=master)](https://codecov.io/github/sodafoundation/api?branch=master) [![Releases](https://img.shields.io/github/release/sodafoundation/api/all.svg?style=flat-square)](https://github.com/sodafoundation/api/releases) [![LICENSE](https://img.shields.io/github/license/sodafoundation/api.svg?style=flat-square)](https://github.com/sodafoundation/api/blob/master/LICENSE) From 43a02e27d686cf3da074229f3c1b9e4ea8f1d905 Mon Sep 17 00:00:00 2001 From: Anvith KS Date: Sat, 8 May 2021 12:06:44 +0530 Subject: [PATCH 3/3] Deleted the Travis CI configuration file --- .travis.yml | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100755 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index 16146e7e4..000000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -dist: xenial -sudo: required - -language: go -go_import_path: github.com/sodafoundation/api - -go: - - 1.12.x - - 1.13.x - - tip - -env: - - TARGET=amd64 - GO111MODULE=on - -services: - - docker - -before_install: - - sudo apt-get update - - sudo apt-get install -y build-essential gcc - - sudo apt-get install -y librados-dev librbd-dev - - sudo apt-get install -y lvm2 tgt open-iscsi - - sudo docker pull p1c2u/openapi-spec-validator - - -matrix: - fast_finish: true - allow_failures: - - go: tip - exclude: - - -install: - # TODO: Remove once source code is fixed for sodafoundation - - ln -s $GOPATH/src/sodafoundation $GOPATH/src/opensds - # Build OpenSDS Controller source code - - make osdsapiserver - - make osdsctl - -script: - - ./install/CI/coverage - - ./install/CI/test - -after_success: - - bash <(curl -s https://codecov.io/bash) - # Clean OpenSDS Controller built data - - make clean