From fe98f89df133ed04cfdc15312abfa90cc847057a Mon Sep 17 00:00:00 2001 From: Matt Johnstone Date: Tue, 1 Oct 2024 22:25:48 +0200 Subject: [PATCH] added go-test workflow --- .github/workflows/go-test.yaml | 35 ++++++++++++++++++++++ .github/workflows/{fmt.yaml => gofmt.yaml} | 0 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/go-test.yaml rename .github/workflows/{fmt.yaml => gofmt.yaml} (100%) diff --git a/.github/workflows/go-test.yaml b/.github/workflows/go-test.yaml new file mode 100644 index 0000000..97c775b --- /dev/null +++ b/.github/workflows/go-test.yaml @@ -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 \ No newline at end of file diff --git a/.github/workflows/fmt.yaml b/.github/workflows/gofmt.yaml similarity index 100% rename from .github/workflows/fmt.yaml rename to .github/workflows/gofmt.yaml