From 90537d5428ff2c36b651f686ef162e7a1d2d39b3 Mon Sep 17 00:00:00 2001 From: Sakala Venkata Krishna Rohit Date: Wed, 3 Jun 2020 10:09:32 +0530 Subject: [PATCH] Add github actions ci yaml --- .github/workflows/ci.yaml | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..269c743 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,60 @@ +name: quarks-utils-ci + +on: [push] + +jobs: + linting: + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.13.4 + uses: actions/setup-go@v2 + with: + go-version: 1.13.4 + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Install dependencies + run: | + go install github.com/onsi/ginkgo/ginkgo + go get -u golang.org/x/lint/golint + curl -LO https://github.com/dominikh/go-tools/releases/download/2020.1.3/staticcheck_linux_amd64.tar.gz + sudo tar xfz staticcheck_linux_amd64.tar.gz --strip-component 1 -C $GOPATH/bin staticcheck/staticcheck + - name: Run lint + run: bin/lint + + unit-tests: + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.13.4 + uses: actions/setup-go@v2 + with: + go-version: 1.13.4 + - uses: actions/checkout@v2 + - uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Install dependencies + run: | + go install github.com/onsi/ginkgo/ginkgo + go get github.com/mattn/goveralls + go get github.com/modocache/gover + - name: Run unit tests + run: | + bin/test-unit + bin/coverage + env: + COVERAGE: true + GOPROXY: "https://proxy.golang.org" + - uses: actions/upload-artifact@master + with: + name: coverage-files + path: ./code-coverage