forked from kedacore/keda
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (141 loc) · 5.81 KB
/
main-build.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: main-build
on:
push:
branches:
- main
jobs:
build:
name: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write # needed for signing the images with GitHub OIDC Token **not production ready**
# build-tools is built from ../../tools/build-tools.Dockerfile
container: ghcr.io/kedacore/build-tools:main
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- id: go-paths
run: |
echo ::set-output name=mod_cache::$(go env GOMODCACHE)
echo ::set-output name=build_cache::$(go env GOCACHE)
- name: Go modules cache
uses: actions/cache@v2.1.7
with:
path: ${{ steps.go-paths.outputs.mod_cache }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Go build cache
uses: actions/cache@v2.1.7
with:
path: ${{ steps.go-paths.outputs.build_cache }}
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
- name: Go modules sync
run: go mod tidy
- name: Test
run: make test
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
# Username used to log in to a Docker registry. If not set then no login will occur
username: ${{ github.repository_owner }}
# Password or personal access token used to log in to a Docker registry. If not set then no login will occur
password: ${{ secrets.GHCR_AUTH_PAT }}
# Server address of Docker registry. If not set then will default to Docker Hub
registry: ghcr.io
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Publish on GitHub Container Registry
run: make publish-multiarch
# https://github.com/sigstore/cosign-installer
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.4.1'
- name: Check Cosign install!
run: cosign version
- name: Sign KEDA images published on GitHub Container Registry
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: make sign-images
validate:
needs: build
name: validate
runs-on: ubuntu-latest
# build-tools is built from ../../tools/build-tools.Dockerfile
container: ghcr.io/kedacore/build-tools:main
concurrency: e2e-tests
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Run end to end tests
env:
AZURE_APP_INSIGHTS_APP_ID: ${{ secrets.AZURE_APP_INSIGHTS_APP_ID }}
AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY: ${{ secrets.AZURE_APP_INSIGHTS_INSTRUMENTATION_KEY }}
AZURE_DATA_EXPLORER_DB: ${{ secrets.AZURE_DATA_EXPLORER_DB }}
AZURE_DATA_EXPLORER_ENDPOINT: ${{ secrets.AZURE_DATA_EXPLORER_ENDPOINT }}
AZURE_DEVOPS_BUILD_DEFINITON_ID: ${{ secrets.AZURE_DEVOPS_BUILD_DEFINITON_ID }}
AZURE_DEVOPS_ORGANIZATION_URL: ${{ secrets.AZURE_DEVOPS_ORGANIZATION_URL }}
AZURE_DEVOPS_PAT: ${{ secrets.AZURE_DEVOPS_PAT }}
AZURE_DEVOPS_POOL_NAME: ${{ secrets.AZURE_DEVOPS_POOL_NAME }}
AZURE_DEVOPS_PROJECT: ${{ secrets.AZURE_DEVOPS_PROJECT }}
AZURE_LOG_ANALYTICS_WORKSPACE_ID: ${{ secrets.AZURE_LOG_ANALYTICS_WORKSPACE_ID }}
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SP_ID: ${{ secrets.AZURE_SP_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY}}
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY}}
DATADOG_SITE: ${{ secrets.DATADOG_SITE}}
GCP_SP_KEY: ${{ secrets.GCP_SP_KEY }}
NEWRELIC_ACCOUNT_ID: ${{ secrets.NEWRELIC_ACCOUNT_ID}}
NEWRELIC_API_KEY: ${{ secrets.NEWRELIC_API_KEY}}
NEWRELIC_LICENSE: ${{ secrets.NEWRELIC_LICENSE}}
OPENSTACK_AUTH_URL: ${{ secrets.OPENSTACK_AUTH_URL }}
OPENSTACK_PASSWORD: ${{ secrets.OPENSTACK_PASSWORD }}
OPENSTACK_PROJECT_ID: ${{ secrets.OPENSTACK_PROJECT_ID }}
OPENSTACK_USER_ID: ${{ secrets.OPENSTACK_USER_ID }}
PREDICTKUBE_API_KEY: ${{ secrets.PREDICTKUBE_API_KEY }}
run: make e2e-test
- name: Delete all e2e related namespaces
if: ${{ always() }}
run: make e2e-test-clean
env:
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SP_ID: ${{ secrets.AZURE_SP_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
validate-arm64:
needs: build
name: validate-arm64
runs-on: ARM64
concurrency: arm-smoke-tests
steps:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
- name: Install prerequisites
run: |
apt update
apt install curl npm make ca-certificates gcc libc-dev -y
env:
DEBIAN_FRONTEND: noninteractive
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Create k8s v1.23 Kind Cluster
uses: JorTurFer/kind-action@main
with:
node_image: kindest/node:v1.23.0@sha256:49824ab1727c04e56a21a5d8372a402fcd32ea51ac96a2706a12af38934f81ac
cluster_name: smoke-tests-cluster
- name: Run smoke test
run: make arm-smoke-test