Skip to content

Commit bf8dec1

Browse files
pikselsimskij
andauthored
chore(ci): run code coverage on main push (#870)
* chore(ci): run code coverage on main push * merge workflows for pushes to main * add workflow dispatch for production releases Co-authored-by: Simon Aronsson <simme@arcticbit.se>
1 parent b644ec6 commit bf8dec1

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

.github/workflows/release-dev.yaml

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,47 @@
1-
name: Release (Develop)
1+
name: Push to main
22

33
on:
4+
workflow_dispatch: {}
45
push:
56
branches:
67
- main
78

89
jobs:
9-
1010
build:
11-
1211
runs-on: ubuntu-latest
13-
1412
steps:
15-
- uses: actions/checkout@v2
16-
17-
- uses: jerray/publish-docker-action@master
18-
with:
19-
username: ${{ secrets.DOCKERHUB_USERNAME }}
20-
password: ${{ secrets.DOCKERHUB_PASSWORD }}
21-
file: dockerfiles/Dockerfile.self-contained
22-
repository: containrrr/watchtower
23-
tags: latest-dev
13+
- uses: actions/checkout@v2
14+
- name: Set up Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: 1.15
18+
- name: Build
19+
run: go build -v ./...
20+
test:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Set up Go
25+
uses: actions/setup-go@v2
26+
with:
27+
go-version: 1.15
28+
- name: Test
29+
run: go test -v -coverprofile coverage.out -covermode atomic ./...
30+
- name: Publish coverage
31+
uses: codecov/codecov-action@v1
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
publish:
35+
needs:
36+
- build
37+
- test
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v2
41+
- uses: jerray/publish-docker-action@master
42+
with:
43+
username: ${{ secrets.DOCKERHUB_USERNAME }}
44+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
45+
file: dockerfiles/Dockerfile.self-contained
46+
repository: containrrr/watchtower
47+
tags: latest-dev

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Release (Production)
22

33
on:
4+
workflow_dispatch: {}
45
release:
56
types:
67
- created

0 commit comments

Comments
 (0)