Skip to content

Deepanshutr/master #858

Deepanshutr/master

Deepanshutr/master #858

Workflow file for this run

name: Test
on:
pull_request:
branches:
- master
- main
paths:
- "**.go"
- "**.mod"
- "**.sum"
jobs:
test-coverage-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.17
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: |
set +e -x
make test
TEST_FAILED=false
[[ $? == 0 ]] && echo "TEST_FAILED=true" >> $GITHUB_ENV
id: test_status
- name: Convert coverage to lcov
if: github.event_name == 'pull_request'
uses: jandelgado/gcov2lcov-action@v1
- name: Code Coverage Report
if: github.event_name == 'pull_request'
uses: vebr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: coverage.lcov
- name: Fail CI if test was failed
if: ${{ env.TEST_FAILED }}
run: |
false