-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (48 loc) · 1.39 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: ci
on:
pull_request:
branches:
- master
push:
branches:
- release/*
- hotfix/*
- master
tags:
- v*
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
RELEASE_VERSION: v0.2.0
DOCKER_IMAGE: wosai/elastic-env-operator
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.14
id: go
- name: Set up Kubebuilder
if: ${{ github.event_name == 'pull_request' }}
run: |
os=$(go env GOOS)
arch=$(go env GOARCH)
curl -L https://go.kubebuilder.io/dl/2.3.1/${os}/${arch} | tar -xz -C /tmp/
sudo mv /tmp/kubebuilder_2.3.1_${os}_${arch} /usr/local/kubebuilder
export PATH=$PATH:/usr/local/kubebuilder/bin
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Test
run: |
go test -race -covermode=atomic -v -coverpkg github.com/wosai/elastic-env-operator/domain/handler ./...
if: ${{ github.event_name == 'pull_request' }}
- name: Test Coverage Report
run: bash <(curl -s https://codecov.io/bash)
- name: Build and Release Docker Image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKERHUB_ORG_USERNAME }}
password: ${{ secrets.DOCKERHUB_ORG_ACCESS_TOKEN }}
repository: wosai/elastic-env-operator
tag_with_ref: true