Skip to content

Commit

Permalink
Update Coverage badge flow (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
oren-zohar committed Apr 17, 2022
1 parent 43d526d commit 7d6db18
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 105 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/cloudbeat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,48 +195,3 @@ jobs:
```
Link to detailed report: https://${{ github.repository_owner }}.github.io/cloudbeat/${{ github.run_number }}
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ (github.event.pull_request_target || github.event.pull_request).head.repo.full_name }}
ref: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Mage Check
uses: magefile/mage-action@v1.6.0
with:
args: check

- name: Mage check license headers
uses: magefile/mage-action@v1.6.0
with:
args: checkLicenseHeaders

- name: Unit-Test Cloudbeat
run: |
GOOS=linux go test ./...
- name: Get diff k8s manifests
uses: technote-space/get-diff-action@v4
with:
PATTERNS: ${{ env.K8S_MANIFEST_DIR }}/**

- name: Run K8s manifest tests
if: env.GIT_DIFF
uses: stefanprodan/kube-tools@v1
with:
kubectl: 1.18.2
kubeval: v0.16.1
command: |
echo "===== run kubeval"
kubeval --strict ${{ env.K8S_MANIFEST_DIR }}/cloudbeat-ds.yaml
59 changes: 0 additions & 59 deletions .github/workflows/post-merge.yml

This file was deleted.

69 changes: 69 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: UnitTests

on:
pull_request_target:
branches:
- main
types: [assigned, opened, synchronize, reopened]
push:
branches:
- main


env:
K8S_MANIFEST_DIR: deploy/k8s/kustomize/base
GO_VERSION: 1.17.2

jobs:
unit_tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ (github.event.pull_request_target || github.event.pull_request).head.repo.full_name }}
ref: ${{ (github.event.pull_request_target || github.event.pull_request).head.sha }}

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Mage Check
uses: magefile/mage-action@v1.6.0
with:
args: check

- name: Mage check license headers
uses: magefile/mage-action@v1.6.0
with:
args: checkLicenseHeaders

- name: Unit-Test Cloudbeat
run: |
GOOS=linux go test ./...
- name: Update coverage
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -service=github

- name: Get diff k8s manifests
uses: technote-space/get-diff-action@v4
with:
PATTERNS: ${{ env.K8S_MANIFEST_DIR }}/**

- name: Run K8s manifest tests
if: env.GIT_DIFF
uses: stefanprodan/kube-tools@v1
with:
kubectl: 1.18.2
kubeval: v0.16.1
command: |
echo "===== run kubeval"
kubeval --strict ${{ env.K8S_MANIFEST_DIR }}/cloudbeat-ds.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Cloudbeat
![Coverage](https://img.shields.io/badge/Coverage-46.4%25-yellow)
[![Coverage Status](https://coveralls.io/repos/github/elastic/cloudbeat/badge.svg?branch=main)](https://coveralls.io/github/elastic/cloudbeat?branch=main)=======
[![Go Report Card](https://goreportcard.com/badge/github.com/elastic/cloudbeat)](https://goreportcard.com/report/github.com/elastic/cloudbeat)
[![Build Status](https://internal-ci.elastic.co/buildStatus/icon?job=cloudbeat%2Fcloudbeat-mbp%2Fmain)](https://internal-ci.elastic.co/job/cloudbeat/job/cloudbeat-mbp/job/main/)

Expand Down

0 comments on commit 7d6db18

Please sign in to comment.