Skip to content

feat: add structs

feat: add structs #22

Workflow file for this run

name: CICD
on:
push:
branches: [main]
pull_request:
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "./go.mod"
- name: Run build binary
run: make install
- name: Vuln
run: make vuln
- name: Run tests
run: make test
- name: Run coverage
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: auto
run: |
total=`go tool cover -func=coverage.out | grep total | awk '{print $3}' | sed 's/%//g'`
if (( $(echo "$total <= 50" | bc -l) )) ; then
COLOR=red
elif (( $(echo "$total > 90" | bc -l) )); then
COLOR=green
else
COLOR=orange
fi
curl "https://img.shields.io/badge/coverage-$total%25-$COLOR" > badge.svg
aws s3api put-object --cache-control no-cache --content-type image/svg+xml --bucket code-coverage --key go-pkgs.svg --body badge.svg --endpoint-url https://a13880696afbb75cf78cdb89324aafbc.r2.cloudflarestorage.com