on:
  push:
    branches:
      - master
  pull_request:
    types: [opened, synchronize, reopened]
name: Sonarqube
jobs:
  sonarcloud:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Test
        run: |
          export PATH=$PATH:${PWD}/bin:$GOPATH/bin:/home/runner/go/bin
          make test
      - name: SonarCloud Scan
        uses: sonarsource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          SONAR_TOKEN: 3caad1285eb0edf2b4f65ee07b3cd8edde6c5176
