-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e97d273
commit faf87aa
Showing
2 changed files
with
81 additions
and
83 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,94 @@ | ||
on: | ||
pull_request: | ||
paths: | ||
- '**/*.go' | ||
- '**/*.mod' | ||
- '**/*.sum' | ||
- '**/*.yaml' | ||
push: | ||
paths: | ||
- '**/*.go' | ||
- '**/*.mod' | ||
- '**/*.sum' | ||
- '**/*.yaml' | ||
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 }} | ||
# on: | ||
# pull_request: | ||
# paths: | ||
# - '**/*.go' | ||
# - '**/*.mod' | ||
# - '**/*.sum' | ||
# - '**/*.yaml' | ||
# push: | ||
# paths: | ||
# - '**/*.go' | ||
# - '**/*.mod' | ||
# - '**/*.sum' | ||
# - '**/*.yaml' | ||
# 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 | ||
- name: Test | ||
run: | | ||
mkdir -p dist/ | ||
echo "hello" > dist/index.html | ||
BUILD_START=$SECONDS | ||
go test -race -v ./... -count=1 -coverprofile=coverage.out | ||
echo SCORE=$(($SECONDS-BUILD_START)) >> "$GITHUB_ENV" | ||
# - 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 | ||
# - name: Test | ||
# run: | | ||
# mkdir -p dist/ | ||
# echo "hello" > dist/index.html | ||
# BUILD_START=$SECONDS | ||
# go test -race -v ./... -count=1 -coverprofile=coverage.out | ||
# echo SCORE=$(($SECONDS-BUILD_START)) >> "$GITHUB_ENV" | ||
|
||
- uses: kevincobain2000/action-coveritup@v1 | ||
with: | ||
type: unit-test-run-time | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: unit-test-run-time | ||
|
||
- name: Coverage | ||
run: | | ||
go tool cover -html=coverage.out -o coverage.html | ||
gocov convert coverage.out | gocov-xml > coverage.xml | ||
- name: Build | ||
run: | | ||
BUILD_START=$SECONDS | ||
go build -ldflags '-s -w' -o main main.go | ||
echo SCORE=$(($SECONDS-BUILD_START)) >> "$GITHUB_ENV" | ||
# - name: Coverage | ||
# run: | | ||
# go tool cover -html=coverage.out -o coverage.html | ||
# gocov convert coverage.out | gocov-xml > coverage.xml | ||
# - name: Build | ||
# run: | | ||
# BUILD_START=$SECONDS | ||
# go build -ldflags '-s -w' -o main main.go | ||
# echo SCORE=$(($SECONDS-BUILD_START)) >> "$GITHUB_ENV" | ||
|
||
- uses: kevincobain2000/action-coveritup@v1 | ||
with: | ||
type: build-time | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: build-time | ||
|
||
- name: Coveritup | ||
run: | | ||
curl -sLk https://raw.githubusercontent.com/kevincobain2000/cover-totalizer/master/install.sh | sh | ||
echo SCORE=`./cover-totalizer coverage.xml` >> "$GITHUB_ENV" | ||
# - name: Coveritup | ||
# 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 | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: coverage | ||
|
||
- name: Go Binary Size | ||
run: | | ||
echo SCORE=`du -sk main | awk '{print $1}'` >> "$GITHUB_ENV" | ||
# - name: Go Binary Size | ||
# run: | | ||
# echo SCORE=`du -sk main | awk '{print $1}'` >> "$GITHUB_ENV" | ||
|
||
- uses: kevincobain2000/action-coveritup@v1 | ||
with: | ||
type: go-binary-size | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-binary-size | ||
|
||
- name: Number of dependencies | ||
run: | | ||
echo SCORE=`go list -m all|wc -l|awk '{$1=$1};1'` >> "$GITHUB_ENV" | ||
# - name: Number of dependencies | ||
# 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 | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# type: go-mod-dependencies | ||
|
||
- name: Number of GO Sec issues | ||
run: | | ||
echo SCORE=`gosec -no-fail --quiet ./...|grep Issues | tail -1 |awk '{print $3}'` >> "$GITHUB_ENV" | ||
# - name: Number of GO Sec issues | ||
# 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: | ||
# type: go-sec-issues | ||
|
||
- uses: kevincobain2000/action-coveritup@v1 | ||
with: | ||
pr_comment: true | ||
# - uses: kevincobain2000/action-coveritup@v1 | ||
# with: | ||
# pr_comment: true |
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