Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update workflows #61

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
5 changes: 4 additions & 1 deletion .github/workflows/dependabot-auto-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Dependabot auto-merge
on: pull_request
on:
check_suite:
types:
- completed

permissions:
contents: write
Expand Down
56 changes: 42 additions & 14 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@
name: Go

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
branches: [ main ]

env:
GO_MODULE: github.com/finleap-connect/backup-operator
Expand All @@ -45,22 +43,52 @@ jobs:
needs: lint
runs-on: ubuntu-latest
steps:
- name: Install Go
- name: Checkout Project
uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout Project
uses: actions/checkout@v3
- name: test

- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run Test
run: |
make test
make coverage
- name: Convert coverage to lcov
uses: jandelgado/[email protected]

- name: Go Coverage Badge
uses: tj-actions/[email protected]
with:
filename: .coverprofile

- name: Verify Changed files
uses: tj-actions/[email protected]
id: verify-changed-files
with:
infile: .coverprofile
- name: Coveralls GitHub Action
uses: coverallsapp/[email protected]
files: README.md

- name: Commit changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "chore: Updated coverage badge."

- name: Push changes
if: steps.verify-changed-files.outputs.files_changed == 'true'
uses: ad-m/github-push-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
github_token: ${{ github.token }}
branch: ${{ github.head_ref }}
13 changes: 13 additions & 0 deletions .github/workflows/greetings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience."
pr-message: "Thanks for implementing a fix, could you ensure that the test covers your changes."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Backup Operator

![Coverage](https://img.shields.io/badge/Coverage-1-red)
[![Build status](https://github.com/finleap-connect/backup-operator/actions/workflows/golang.yaml/badge.svg)](https://github.com/finleap-connect/backup-operator/actions/workflows/golang.yaml)
[![Coverage Status](https://coveralls.io/repos/github/finleap-connect/backup-operator/badge.svg?branch=main)](https://coveralls.io/github/finleap-connect/backup-operator?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/finleap-connect/backup-operator)](https://goreportcard.com/report/github.com/finleap-connect/backup-operator)
[![Go Reference](https://pkg.go.dev/badge/github.com/finleap-connect/backup-operator.svg)](https://pkg.go.dev/github.com/finleap-connect/backup-operator)
[![GitHub release](https://img.shields.io/github/release/finleap-connect/backup-operator.svg)](https://github.com/finleap-connect/backup-operator/releases)
Expand Down