(feat) support same metric types #52
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: | |
pull_request: | |
push: | |
tags-ignore: | |
- '**' | |
branches: | |
- '**' | |
name: "Cover It Up v1" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
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: Setup Node.js ${{ matrix.node-versions }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- 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 | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest | |
- name: Setup Node.js ${{ matrix.node-versions }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
- uses: shogo82148/actions-setup-mysql@v1 | |
with: | |
mysql-version: "8.0" | |
- name: NPM Install | |
working-directory: app/frontend | |
run: | | |
START=$SECONDS | |
npm install | |
echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: npm-install-time | |
- name: NPM Build | |
working-directory: app/frontend | |
run: | | |
START=$SECONDS | |
npm run build | |
echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: npm-build-time | |
- name: Go Build | |
working-directory: app | |
run: | | |
START=$SECONDS | |
go mod tidy | |
go build -ldflags '-s -w' -o main main.go | |
echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-build-time | |
- name: Lint Errors | |
working-directory: app | |
run: | | |
echo SCORE=`golangci-lint run ./... | grep -c "\^"` >> "$GITHUB_ENV" | |
shell: bash | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-lint-errors | |
- name: Test | |
working-directory: app | |
run: | | |
START=$SECONDS | |
go test -race -v ./... -count=1 -coverprofile=coverage.out | |
echo SCORE=$(($SECONDS-START)) >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-test-run-time | |
- name: Coverage | |
working-directory: app | |
run: | | |
gocov convert coverage.out | gocov-xml > coverage.xml | |
- name: Coveritup | |
working-directory: app | |
run: | | |
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh | |
echo SCORE=`./cover-totalizer coverage.xml` >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: coverage | |
- name: Go Binary Size | |
working-directory: app | |
run: | | |
echo SCORE=`du -sk main | awk '{print $1}'` >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-binary-size | |
- name: Number of dependencies | |
working-directory: app | |
run: echo SCORE=`go list -m all|wc -l|awk '{$1=$1};1'` >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-mod-dependencies | |
- name: Number of GO Sec issues | |
working-directory: app | |
run: echo SCORE=`gosec -no-fail --quiet ./...|grep Issues | tail -1 |awk '{print $3}'` >> "$GITHUB_ENV" | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
type: go-sec-issues | |
- uses: kevincobain2000/action-coveritup@v1 | |
with: | |
pr_comment: true |