build: run tests before build (#737)

* build: run Go tests before build
This commit is contained in:
ze0s 2023-03-04 22:22:39 +01:00 committed by GitHub
parent 13a74f7cc8
commit 65f51da68e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,11 +41,38 @@ jobs:
name: web-build
path: web/build
test:
name: Test
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: web
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Download web production build
uses: actions/download-artifact@v3
with:
name: web-build
path: web/build
# 1.20 is the last version to support Windows < 10, Server < 2016, and MacOS < 1.15.
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.20.1'
cache: true
- name: Test
run: go test -v ./...
goreleaserbuild:
name: Build Go binaries
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: web
needs: [web, test]
steps:
- name: Checkout
uses: actions/checkout@v3
@ -84,7 +111,7 @@ jobs:
name: Build & publish binaries and images
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: web
needs: [web, test]
steps:
- name: Checkout
uses: actions/checkout@v3
@ -122,7 +149,7 @@ jobs:
docker:
name: Build and publish Docker images
runs-on: ubuntu-latest
needs: web
needs: [web, test]
steps:
- name: Checkout
uses: actions/checkout@v3