Skip to content

Commit

Permalink
Run unit tests within goreleaser
Browse files Browse the repository at this point in the history
Reduces CI jobs, simplifies local build too
  • Loading branch information
ccremer committed Mar 5, 2020
1 parent df2901b commit 3cd9b1c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/test.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Test
name: Build

on:
push:
Expand All @@ -11,18 +11,7 @@ on:
types: [opened, reopened]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: /home/runner/go/pkg/mod
key: go-mod
- name: Run unit tests
run: go test ./...

build:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@ on:
- "*"

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: /home/runner/go/pkg/mod
key: go-mod
- name: Run unit tests
run: go test ./...

release:
goreleaser:
runs-on: ubuntu-latest
needs:
- test
Expand Down
4 changes: 4 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Make sure to check the documentation at http://goreleaser.com

before:
hooks:
- go test ./...

builds:
- env:
- CGO_ENABLED=0 # this is needed otherwise the Docker image build is faulty
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![dockeri.co](https://dockeri.co/image/appuio/image-cleanup)](https://hub.docker.com/r/appuio/image-cleanup)

![](https://img.shields.io/github/workflow/status/appuio/image-cleanup/Release)
![](https://img.shields.io/github/workflow/status/appuio/image-cleanup/Build)
![](https://img.shields.io/github/v/release/appuio/image-cleanup?include_prereleases)
![](https://img.shields.io/github/issues-raw/appuio/image-cleanup)
![](https://img.shields.io/github/issues-pr-raw/appuio/image-cleanup)
Expand Down

0 comments on commit 3cd9b1c

Please sign in to comment.