Update GitHub Actions workflow to include testing step before build

This commit is contained in:
Mo Tarbin 2025-01-20 22:15:04 -05:00
parent 63fcdb6130
commit aec90c3e51

View file

@ -1,13 +1,11 @@
name: Build name: Test and Build
on: on:
push:
branches: [ "main", "develop" ]
pull_request: pull_request:
branches: [ "main", "develop" ] branches: [ "main" ]
jobs: jobs:
build: test:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -15,7 +13,21 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v4 uses: actions/setup-go@v4
with: with:
go-version: '1.23' go-version: '1.22'
- name: Run tests
run: go test ./...
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22'
- name: Build - name: Build
run: go build -v ./... run: go build -v ./...