Update GitHub Actions workflow to include testing step before build
This commit is contained in:
parent
63fcdb6130
commit
aec90c3e51
1 changed files with 19 additions and 7 deletions
26
.github/workflows/go-build.yml
vendored
26
.github/workflows/go-build.yml
vendored
|
@ -1,13 +1,11 @@
|
|||
name: Build
|
||||
name: Test and Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "develop" ]
|
||||
pull_request:
|
||||
branches: [ "main", "develop" ]
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
@ -15,7 +13,21 @@ jobs:
|
|||
- name: Set up Go
|
||||
uses: actions/setup-go@v4
|
||||
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
|
||||
run: go build -v ./...
|
||||
run: go build -v ./...
|
Loading…
Add table
Reference in a new issue