Skip to content

Commit 4decaa8

Browse files
authored
ci: Only publish if tests pass (#86)
* ci: Only publish if tests pass * Cosmetics
1 parent 2f7b93a commit 4decaa8

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
name: Continuous Deployment
2-
3-
on:
4-
push:
5-
tags:
6-
- "*"
7-
8-
permissions:
9-
contents: write
10-
1+
on: [push, pull_request]
2+
name: Test, Build and Publish
113
jobs:
4+
tests:
5+
strategy:
6+
matrix:
7+
os: [ubuntu-latest, macos-latest]
8+
runs-on: ${{ matrix.os }}
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-go@v3
12+
with:
13+
go-version: "1.20.x"
14+
- name: Run tests
15+
run: go test -race ./...
16+
1217
goreleaser:
13-
name: Publish release to github/brew
18+
name: Build and Publish
19+
needs: tests
1420
runs-on: ubuntu-latest
21+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
1522
steps:
1623
- name: Checkout
1724
uses: actions/checkout@v3
@@ -31,15 +38,15 @@ jobs:
3138
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3239

3340
check_brew:
34-
name: Check brew tap has been updated
35-
runs-on: macos-latest
41+
name: Check Brew Tap
3642
needs: goreleaser
43+
runs-on: macos-latest
3744
steps:
38-
- name: brew tap/install
45+
- name: Install gitmux with brew
3946
run: |
4047
brew tap arl/arl
4148
brew install gitmux
4249
gitmux -V
43-
- name: check gitmux version
50+
- name: Check installed gitmux version
4451
run: |
4552
[ v$(gitmux -V) == "$GITHUB_REF_NAME" ]

.github/workflows/ci.yml

-15
This file was deleted.

0 commit comments

Comments
 (0)