mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
build: run tests before build (#737)
* build: run Go tests before build
This commit is contained in:
parent
13a74f7cc8
commit
65f51da68e
1 changed files with 30 additions and 3 deletions
33
.github/workflows/release.yml
vendored
33
.github/workflows/release.yml
vendored
|
@ -41,11 +41,38 @@ jobs:
|
||||||
name: web-build
|
name: web-build
|
||||||
path: 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:
|
goreleaserbuild:
|
||||||
name: Build Go binaries
|
name: Build Go binaries
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: web
|
needs: [web, test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -84,7 +111,7 @@ jobs:
|
||||||
name: Build & publish binaries and images
|
name: Build & publish binaries and images
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: web
|
needs: [web, test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
@ -122,7 +149,7 @@ jobs:
|
||||||
docker:
|
docker:
|
||||||
name: Build and publish Docker images
|
name: Build and publish Docker images
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: web
|
needs: [web, test]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue