Skip to content

Commit

Permalink
ci workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Quentin JEROME <[email protected]>
  • Loading branch information
qjerome committed Sep 15, 2023
1 parent 596310d commit 1b81814
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'

- name: Build
run: make ci-build

- name: Test
run: go test -failfast ./...

- uses: actions/checkout@v3
with:
ref: coverage
path: coverage-branch

- name: Coverage
run: |
cd $GITHUB_WORKSPACE/coverage-branch
curl -s "https://img.shields.io/badge/coverage-$(go test -cover | grep -oP '\s.*?%'| tr -d ' ' | sed 's/%/%25/')-informational?style=for-the-badge" > badge.svg
git config --local user.name "Coverage Bot"
git config --local user.email "<>"
git add -A
git commit -m "Coverage updated commit=$GITHUB_SHA" || true
git push

0 comments on commit 1b81814

Please sign in to comment.