added go-test workflow

This commit is contained in:
Matt Johnstone 2024-10-01 22:25:48 +02:00
parent 2c8087380c
commit fe98f89df1
No known key found for this signature in database
GPG Key ID: BE985FBB9BE7D3BB
2 changed files with 35 additions and 0 deletions

35
.github/workflows/go-test.yaml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Go Tests
on:
pull_request:
jobs:
test:
name: Run Go Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.22"
- name: Install dependencies
run: go mod download
- name: Test rpc package
run: go test -v ./pkg/rpc
- name: Test solana_exporter
run: go test -v ./cmd/solana_exporter
- name: Run all tests with coverage
run: go test -v -coverprofile=coverage.out ./...
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: coverage-report
path: coverage.out