github.com/iDigitalFlame/xmt@v0.5.4/.github/workflows/checks.yaml (about)

     1  name: Code Analysis
     2  
     3  on:
     4    push:
     5      branches: [ main ]
     6    pull_request:
     7      branches: [ main ]
     8    workflow_dispatch:
     9  
    10  jobs:
    11    build:
    12      runs-on: ${{ matrix.os }}
    13      strategy:
    14        matrix:
    15          os: [ubuntu-latest]
    16          go: [1.20]
    17      steps:
    18      - name: Setup Go
    19        uses: actions/setup-go@v3
    20        with:
    21          go-version: ">=1.20"
    22  
    23      - name: Checkout Code
    24        uses: actions/checkout@v3
    25  
    26      - name: Run staticcheck
    27        continue-on-error: true
    28        uses: dominikh/staticcheck-action@v1.2.0
    29        with:
    30          checks: all
    31          version: "latest"
    32          install-go: false
    33          cache-key: ${{ matrix.go }}
    34          working-directory: ${{ matrix.dir }}
    35  
    36      - name: Run Tests
    37        run: |
    38          go test ./...
    39  
    40      - name: Generate Coverage Profile
    41        run: |
    42          go test -cover ./... -coverprofile coverage.txt -coverpkg ./...
    43  
    44      - name: Upload coverage reports to Codecov
    45        run: |
    46          curl -Os https://uploader.codecov.io/latest/linux/codecov
    47          chmod +x codecov
    48          ./codecov --file coverage.txt