Skip to content

Commit

Permalink
Merge pull request #285 from vshn/ci-run
Browse files Browse the repository at this point in the history
Rework GitHub workflows
  • Loading branch information
ccremer authored Jan 18, 2021
2 parents 97ff1a0 + 1520607 commit 8bb1b4a
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 98 deletions.
87 changes: 0 additions & 87 deletions .github/workflows/build.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: E2E

on:
pull_request:
branches:
- master

jobs:
e2e-test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- kind-node-version: v1.20.0
crd-spec-version: v1
- kind-node-version: v1.13.12 # we cannot go lower than that because of Kind, see https://github.com/kubernetes-sigs/kind/issues/1853
crd-spec-version: v1beta1
steps:
- uses: actions/checkout@v2
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run e2e tests
run: make crd e2e-test -e CRD_SPEC_VERSION=${{ matrix.crd-spec-version }} -e KIND_NODE_VERSION=${{ matrix.kind-node-version }} -e KIND_KUBECTL_ARGS=--validate=false -e bats_args="-F junit"
- name: Publish Test Report
uses: mikepenz/action-junit-report@v2
if: success() || failure()
with:
report_paths: '**/e2e/TestReport-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
check_name: e2e-report (${{ matrix.kind-node-version }}, ${{ matrix.crd-spec-version }})
8 changes: 1 addition & 7 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: Lint

on:
pull_request: {}
push:
branches:
- master
- development
tags-ignore:
- "*"
pull_request:
branches:
- master
- development

jobs:
lint:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Push
name: Master

on:
push:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Determine Go version from go.mod
run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: make test
- name: Upload code coverage report to Code Climate
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: b25e8875aef082d5eee059d71d76dac6d3e0ed23847f6004c1598afe35dadff5
with:
coverageLocations: cover.out:gocov
prefix: github.com/${{ github.repository }}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Build](https://img.shields.io/github/workflow/status/vshn/k8up/Build)][build]
[![Build](https://img.shields.io/github/workflow/status/vshn/k8up/Test)][build]
![Go version](https://img.shields.io/github/go-mod/go-version/vshn/k8up)
![Kubernetes version](https://img.shields.io/badge/k8s-v1.20-blue)
[![Version](https://img.shields.io/github/v/release/vshn/k8up)][releases]
[![Maintainability](https://img.shields.io/codeclimate/maintainability/vshn/k8up)][codeclimate]
[![GitHub downloads](https://img.shields.io/github/downloads/vshn/k8up/total)][releases]
[![Docker image](https://img.shields.io/docker/pulls/vshn/k8up)][dockerhub]
[![License](https://img.shields.io/github/license/vshn/k8up)][license]
Expand Down Expand Up @@ -122,8 +123,9 @@ make clean
There are a number of example configurations in [`config/samples`](config/samples).
Apply them using `kubectl apply -f config/samples/somesample.yaml`

[build]: https://github.com/vshn/k8up/actions?query=workflow%3ABuild
[build]: https://github.com/vshn/k8up/actions?query=workflow%3ATest
[releases]: https://github.com/vshn/k8up/releases
[license]: https://github.com/vshn/k8up/blob/master/LICENSE
[dockerhub]: https://hub.docker.com/r/vshn/k8up
[detik]: https://github.com/bats-core/bats-detik
[codeclimate]: https://codeclimate.com/github/vshn/k8up
2 changes: 1 addition & 1 deletion e2e/test1.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ DEBUG_DETIK="true"
echo "$output"

try "at most 10 times every 2s to find 1 pod named 'k8up-operator' with '.spec.containers[*].image' being '${E2E_IMAGE}'"
try "at most 10 times every 2s to find 1 pod named 'k8up-operator' with 'status' being 'running'"
try "at most 20 times every 2s to find 1 pod named 'k8up-operator' with 'status' being 'running'"

}

0 comments on commit 8bb1b4a

Please sign in to comment.