Skip to content

Merge pull request #423 from uselagoon/default-codeql #174

Merge pull request #423 from uselagoon/default-codeql

Merge pull request #423 from uselagoon/default-codeql #174

Workflow file for this run

name: coverage
on:
push:
branches:
- main
permissions: {}
jobs:
coverage:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: stable
- name: Calculate coverage
run: |
go test -v -covermode=atomic -coverprofile=cover.out.raw -coverpkg=./... ./...
# remove generated code from coverage calculation
grep -Ev 'internal/mock|_enumer.go' cover.out.raw > cover.out
- name: Generage coverage badge
uses: vladopajic/go-test-coverage@97ecc524075d8ece0e1a406edec1c191e2dd3277 # v2.8.3
with:
profile: cover.out
local-prefix: github.com/uselagoon/lagoon-ssh-portal
git-token: ${{ secrets.GITHUB_TOKEN }}
# orphan branch for storing badges
git-branch: badges