forked from kubernetes-sigs/work-api
-
Notifications
You must be signed in to change notification settings - Fork 6
119 lines (109 loc) · 2.85 KB
/
ci.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: CI Workflow
on:
push:
branches:
- master
- release-*
pull_request:
branches:
- master
- release-*
- Feature/*
workflow_dispatch: {}
defaults:
run:
working-directory: go/src/sigs.k8s.io/work-api
env:
# Common versions
GO_VERSION: 1.17.x
GO_PATH: '/home/runner/work/work-api/work-api/go'
jobs:
detect-noop:
runs-on: ubuntu-latest
outputs:
noop: ${{ steps.noop.outputs.should_skip }}
steps:
- name: Detect No-op Changes
id: noop
uses: fkirc/skip-duplicate-actions@v3.3.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
paths_ignore: '["**.md", "**.mdx", "**.png", "**.jpg"]'
do_not_skip: '["workflow_dispatch", "schedule", "push"]'
concurrent_skipping: false
# verify:
# name: verify
# runs-on: ubuntu-latest
# steps:
# - name: checkout code
# uses: actions/checkout@v2
# with:
# fetch-depth: 1
# path: go/src/sigs.k8s.io/work-api
#
# - name: install Go
# uses: actions/setup-go@v2
# with:
# go-version: ${{ env.GO_VERSION }}
#
# - name: verify
# run: hack/verify-all.sh -v
# env:
# GOPATH: ${{ env.GO_PATH }}
test:
name: unit test
runs-on: ubuntu-latest
if: needs.detect-noop.outputs.noop != 'true'
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
fetch-depth: 1
path: go/src/sigs.k8s.io/work-api
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Get dependencies
run: go get -v -t -d ./...
- name: make test
run: make test
env:
GOPATH: ${{ env.GO_PATH }}
# - name: Upload report
# uses: codecov/codecov-action@v3
# with:
# ## Comma-separated list of files to upload
# files: go/src/sigs.k8s.io/work-api/cover.out
# flags: ci-tests
# name: codecov-umbrella
# fail_ci_if_error: true
e2e:
name: e2e
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
path: go/src/sigs.k8s.io/work-api
- name: install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: images
run: make docker-build
env:
GOPATH: '/home/runner/work/work-api/work-api/go'
- name: setup kind
uses: engineerd/setup-kind@v0.5.0
with:
version: v0.11.1
- name: Load image on the nodes of the cluster
run: |
kind load docker-image --name=kind work-api-controller:latest
- name: Run e2e test
run: |
make test-e2e
env:
KUBECONFIG: /home/runner/.kube/config