Skip to content

Merge pull request #6 from zeuslawyer/zp-patches #8

Merge pull request #6 from zeuslawyer/zp-patches

Merge pull request #6 from zeuslawyer/zp-patches #8

Workflow file for this run

name: Go Build & Test
on:
# Run tests for pull requests to the main branch
pull_request:
branches: [main]
# Run tests on pushes to the development branch
push:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup Go environment (replace with your desired version)
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
# Cache Go modules to improve performance
- name: Cache Go modules
uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-go-
# Build the project
- name: Build Go project
run: go build -v ./...
# Run tests only if build is successful (fail-fast)
- name: Run tests
if: success() # Only run if previous step succeeded
run: go test -v ./...