Skip to content

Commit

Permalink
chore(ci): run code coverage on main push (#870)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
piksel and simskij authored Apr 18, 2021
1 parent b644ec6 commit bf8dec1
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,47 @@
name: Release (Develop)
name: Push to main

on:
workflow_dispatch: {}
push:
branches:
- main

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: jerray/publish-docker-action@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
file: dockerfiles/Dockerfile.self-contained
repository: containrrr/watchtower
tags: latest-dev
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Build
run: go build -v ./...
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Test
run: go test -v -coverprofile coverage.out -covermode atomic ./...
- name: Publish coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
needs:
- build
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jerray/publish-docker-action@master
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
file: dockerfiles/Dockerfile.self-contained
repository: containrrr/watchtower
tags: latest-dev
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release (Production)

on:
workflow_dispatch: {}
release:
types:
- created
Expand Down

0 comments on commit bf8dec1

Please sign in to comment.