AlbinoGeek/number-place

View on GitHub
.github/workflows/CI.yml

Summary

Maintainability
Test Coverage
name: "CI"
on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Setup Golang 1.15.x
      if: success()
      uses: actions/setup-go@v2
      with:
        go-version: '^1.15.x'
    
    - name: Checkout repository
      uses: actions/checkout@v2
    
    - name: Get dependencies
      run: |
        sudo apt-get update
        sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
    
    - name: Perform make all
      run: make all

  lint:
    runs-on: ubuntu-latest
    steps:
    - name: Setup Golang 1.15.x
      if: success()
      uses: actions/setup-go@v2
      with:
        go-version: '^1.15.x'
    
    - name: Checkout repository
      uses: actions/checkout@v2
    
    - name: Get dependencies
      run: |
        sudo apt-get update
        sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev
        GO111MODULE=off go get golang.org/x/tools/cmd/goimports                               
        GO111MODULE=off go get github.com/fzipp/gocyclo/cmd/gocyclo
        GO111MODULE=off go get golang.org/x/lint/golint
        GO111MODULE=off go get honnef.co/go/tools/cmd/staticcheck

    - name: go vet
      run: go vet -tags ci ./...
    
    - name: goimports
      run: test -z $(goimports -e -d . | tee /dev/stderr)
    
    - name: gocyclo
      run: gocyclo -over 50 .
    
    - name: golint
      run: golint -set_exit_status $(go list -tags ci ./...)
 
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v1
      with:
        languages: 'go'

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v1

  # coverage:
  #   runs-on: ubuntu-latest
  #   steps:
  #   - name: Setup Golang 1.15.x
  #     if: success()
  #     uses: actions/setup-go@v2
  #     with:
  #       go-version: '^1.15.x'
    
  #   - name: Checkout repository
  #     uses: actions/checkout@v2
    
  #   - name: Get dependencies
  #     run: |
  #       sudo apt-get update
  #       sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev

  #   - name: Calc coverage
  #     run: |
  #       go test -v -covermode=count -coverprofile=coverage.out ./...
    
  #   - name: Convert coverage.out to coverage.lcov
  #     uses: jandelgado/gcov2lcov-action@v1.0.6
    
  #   - name: Coveralls GitHub Action
  #     uses: coverallsapp/github-action@v1.1.2
  #     with:
  #       github-token: ${{ secrets.GITHUB_TOKEN }}
  #       path-to-lcov: coverage.lcov