feat: new flag options for cache #287
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: "Cover It Up" | |
jobs: | |
coveritup: | |
strategy: | |
matrix: | |
go-version: [latest] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: kevincobain2000/action-gobrew@v2 | |
with: | |
version: ${{ matrix.go-version }} | |
- name: Install Tools | |
run: | | |
go install github.com/securego/gosec/v2/cmd/gosec@latest | |
go install github.com/axw/gocov/gocov@latest | |
go install github.com/AlekSi/gocov-xml@latest | |
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh | |
- name: Unit Test | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: unit-test-run-time | |
command: go test -race -v ./... -count=1 -coverprofile=coverage.out | |
record: runtime | |
- name: Benchmark Test | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: allocs-per-op | |
command: go test -count 1 -bench=. ./... -benchmem|grep allocs|awk '{ print $(--NF)}' | |
record: score | |
metric: alloc | |
- name: Coverage | |
run: gocov convert coverage.out | gocov-xml > coverage.xml | |
- name: Coverage Totalizer | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
command: ./cover-totalizer coverage.xml | |
type: coverage | |
- name: Build time | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: build-time | |
command: go build -o main ./cmd/gobrew | |
record: runtime | |
- name: Go Binary Size | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: go-binary-size | |
command: du -sk main | awk '{print $1}' | |
- name: Go Mod Dependencies | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: go-mod-dependencies | |
command: go list -m all|wc -l|awk '{$1=$1};1' | |
- name: Go Sec Issues | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
type: go-sec-issues | |
command: gosec -no-fail --quiet ./...|grep Issues | tail -1 |awk '{print $3}' | |
- name: PR Comment | |
uses: kevincobain2000/action-coveritup@v2 | |
with: | |
pr_comment: true |