Skip to content

[+] feat: Allow passing parameter with a single slice or array for Ge… #133

[+] feat: Allow passing parameter with a single slice or array for Ge…

[+] feat: Allow passing parameter with a single slice or array for Ge… #133

name: Build
on:
push:
branches:
- 'master'
- 'feature/**'
- 'dev/**'
env:
CODECOV_TOKEN: '2fc0d617-8e9a-47d7-ab58-52fa92b23741'
MAIN_GO_VER: '1.16'
MAIN_HOST_OS: 'ubuntu-latest'
jobs:
go_test_and_coverage:
strategy:
max-parallel: 6
matrix:
GO_VER: ['1.16']
HOST_OS: ['ubuntu-latest']
runs-on: ${{ matrix.HOST_OS }}
steps:
- name: Checkout Repositary
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.GO_VER }}
id: go
- name: Get Dependencies
run: |
echo GO_VER = ${{ matrix.GO_VER }}
go get golang.org/x/tools/cmd/cover
go install github.com/mattn/goveralls || go get github.com/mattn/goveralls
go get .
- name: Show Environments
run: |
echo repo status ======== && git status
echo GO_VER = ${{ matrix.GO_VER }}
echo HOST_OS = ${{ matrix.HOST_OS }}
which goveralls
echo envs ======== && printenv
- name: Test and Generate Coverage Report
run: |
go test -v -failfast -cover -covermode=atomic -coverprofile=coverage.out
# - name: Upload Coverage to Goveralls
# run: |
# goveralls -coverprofile=coverage.out -repotoken ${{ env.COVERALLS_TOKEN }}
# - name: Upload Coverage to Codecov
# if: ${{ matrix.GO_VER }} == ${{ env.MAIN_GO_VER }}
# run: |
# bash <(curl -s https://codecov.io/bash) -t ${{ env.CODECOV_TOKEN }}
# - name: Convert Coverage file to lcov format
# uses: jandelgado/gcov2lcov-action@v1.0.8
# with:
# infile: ./coverage.out
# outfile: ./coverage.lcov
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage.out
fail_ci_if_error: true
flags: unittests
name: codecov-umbrella
path_to_write_report: ./coverage/codecov_report.txt
verbose: true
# - name: Coveralls GitHub Action
# uses: coverallsapp/github-action@1.1.3
# with:
# path-to-lcov: ./coverage.lcov
# github-token: ${{ secrets.GITHUB_TOKEN }}