diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f5ba59e..685f269 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,7 @@ permissions: jobs: build: + name: "Build" runs-on: 'ubuntu-latest' steps: - uses: 'actions/checkout@v4' @@ -28,12 +29,29 @@ jobs: - uses: 'actions/setup-go@v5' - name: "Run tests" run: "go test -cover -coverprofile=coverage.out -covermode atomic ./..." + - name: "Archive code coverage results" uses: "actions/upload-artifact@v4" with: name: "code-coverage" path: "coverage.out" + coverage-report: + name: "Coverage Reporting" + needs: 'test' + runs-on: 'ubuntu-latest' + permissions: + contents: "write" + actions: "read" + pull-requests: "write" + steps: + - uses: "fgrosse/go-coverage-report@v1.1.1" + name: "PR Coverage Report" + if: "${{ github.event_name == 'pull_request' }}" + with: + coverage-artifact-name: "code-coverage" + coverage-file-name: "coverage.out" + stringer: needs: 'build' runs-on: 'ubuntu-latest' @@ -44,6 +62,13 @@ jobs: - run: 'go generate unifi/device.go' - run: 'git diff --compact-summary --exit-code' + yamllint: + name: "YAML Lint" + runs-on: 'ubuntu-latest' + steps: + - uses: 'actions/checkout@v4' + - uses: 'ibiqlik/action-yamllint@v3' + lint: name: "Lint" runs-on: 'ubuntu-latest' @@ -52,13 +77,8 @@ jobs: - uses: 'actions/setup-go@v5' - uses: 'golangci/golangci-lint-action@v6' - yamllint: - runs-on: 'ubuntu-latest' - steps: - - uses: 'actions/checkout@v4' - - uses: 'ibiqlik/action-yamllint@v3' - test-codegen: + name: "Test Codegen run" runs-on: "ubuntu-latest" steps: - uses: "actions/checkout@v4"