Skip to content

feat : add github actions tests workflow #4

feat : add github actions tests workflow

feat : add github actions tests workflow #4

Workflow file for this run

name: Tests
on:
pull_request:
push:
branches:
- main
concurrency:
group: ci-${{ github.ref }}-tests
cancel-in-progress: true
jobs:
tests:
name: Tests and code coverage
runs-on: ubuntu-latest
steps:
- name: Install GO
uses: actions/setup-go@v3
with:
go-version: "1.22"
- name: Checkout code
uses: actions/checkout@v3
- id: get_diff
uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: run all tests and generate coverage
run: go test -v -mod=readonly -timeout 30m -coverprofile=coverage.txt -tags='norace' -covermode=atomic `go list ./... | grep -v simapp`
if: steps.get_diff.outputs.changed == 'true'
- name: Upload codecov report
uses: codecov/[email protected]
with:
file: coverage.txt
if: steps.get_diff.outputs.changed == 'true'