diff --git a/.github/workflows/flow.yml b/.github/workflows/flow.yml new file mode 100644 index 0000000..a35da28 --- /dev/null +++ b/.github/workflows/flow.yml @@ -0,0 +1,40 @@ +name: go-slm + +on: [ push, pull_request ] + +jobs: + test: + strategy: + matrix: + go-version: [1.18.x] + os: [ ubuntu-latest ] #[ ubuntu-latest, macos-latest, windows-latest ] + runs-on: ${{ matrix.os }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Check cache + uses: actions/cache@v2 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Test + run: go test -v ./... + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/setup-go@v2 + with: + go-version: '1.18' + - name: Run coverage + run: go test -v ./... -coverprofile=coverage.out -covermode=atomic + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 diff --git a/README.md b/README.md index 06d756a..0aa2921 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ + +![go-slm](https://github.com/kaanaktas/go-slm/workflows/go-slm/badge.svg) +[![codecov](https://codecov.io/gh/kaanaktas/go-slm/branch/main/graph/badge.svg)](https://codecov.io/gh/kaanaktas/go-slm) + # go-slm go-slm is a policy-based service level management library that enforces policy requirements as per service. Different policy rules can be combined diff --git a/main_test.go b/main_test.go new file mode 100644 index 0000000..45fcc77 --- /dev/null +++ b/main_test.go @@ -0,0 +1,7 @@ +package main + +import "testing" + +func Test(t *testing.T) { + main() +}