github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/.github/workflows/build.yml (about)

     1  name: Build
     2  
     3  on:
     4    push:
     5      branches:
     6        - master
     7  
     8  
     9  jobs:
    10    build:
    11      name: Build
    12      runs-on: ubuntu-latest
    13      strategy:
    14        matrix:
    15          go-version: [ '1.21.3' ]
    16      permissions: read-all
    17      steps:
    18        - uses: actions/checkout@v2
    19          with:
    20            fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
    21        - name: Setup Go 1.21.3
    22          uses: actions/setup-go@v4
    23          with:
    24            # Semantic version range syntax or exact version of Go
    25            go-version: '1.21.3'
    26        - name: Test with the Go CLI
    27          run: go test --timeout 10m -coverprofile=coverage.out ./...
    28        - uses: sonarsource/sonarqube-scan-action@master
    29          env:
    30            SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    31            SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
    32       
    33        # If you wish to fail your job when the Quality Gate is red, uncomment the
    34        # following lines. This would typically be used to fail a deployment.
    35        # - uses: sonarsource/sonarqube-quality-gate-action@master
    36        #   timeout-minutes: 5
    37        #   env:
    38        #     SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}