.github/workflows/ubuntu.yml

Summary

Maintainability
Test Coverage
name: Ubuntu
on:
  push:
    paths-ignore:
      - "**.md"
  schedule:
    - cron: "0 21 * * 0"

jobs:
  build:
    name: Build on Ubuntu
    runs-on: ${{ matrix.vm-os }}
    strategy:
      max-parallel: 10
      fail-fast: false
      matrix:
        vm-os: [ubuntu-latest]
        go-version: [1.13.15, 1.14.11, 1.15.4]

    steps:
      - name: Set up Go ${{ matrix.go-version }}
        uses: actions/setup-go@v1
        with:
          go-version: ${{ matrix.go-version }}
        id: go

      - name: Check out code into the Go module directory
        uses: actions/checkout@v1
        with:
          fetch-depth: 2

      - name: Get dependencies
        shell: bash
        run: |
          go get -v -t -d ./...
          if [ -f Gopkg.toml ]; then
              curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
              dep ensure
          fi

      - name: Build & Test
        shell: bash
        run: script/build.sh ci

      - name: Upload report to Codecov
        uses: codecov/codecov-action@v1.0.3
        with:
          token: ${{secrets.codecov_token}}
          file: ./coverage.txt

      - name: Upload report to Codacy
        shell: bash
        run: |
          export GOPATH=$(go env GOPATH)
          export GOBIN=$GOPATH/bin
          export PATH=$PATH:$GOBIN
          go get github.com/schrej/godacov
          godacov -t $CODACY_PROJECT_TOKEN -r ./coverage.txt -c $GITHUB_SHA
        env:
          CODACY_PROJECT_TOKEN: ${{ secrets.codacy_token }}

      - name: Upload report to DeepSource
        shell: bash
        run: |
          curl https://deepsource.io/cli | sh
          ./bin/deepsource report --analyzer test-coverage --key go --value-file ./coverage.txt
        env:
          DEEPSOURCE_DSN: ${{ secrets.deepsource_dsn }}