feat: add GitHub Actions workflow for running tests

This commit is contained in:
Prad Nukala 2024-10-07 21:31:56 -04:00
parent 59944e19db
commit 2772e568d5

60
.github/workflows/run-tests.yml vendored Normal file
View File

@ -0,0 +1,60 @@
name: Run Tests
on:
push:
branches:
- feature/*
jobs:
test-unit:
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- run: make test-unit
test-race:
runs-on: ubuntu-latest
name: Run Race Tests
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- run: make test-race
test-cover:
runs-on: ubuntu-latest
name: Run Coverage Tests
continue-on-error: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.22"
check-latest: true
- run: make test-cover