generated from kedacore/github-template
-
Notifications
You must be signed in to change notification settings - Fork 103
79 lines (65 loc) · 1.97 KB
/
tests.yaml
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
name: Validate
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
validate:
name: validate - ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
container: ghcr.io/kedacore/keda-tools:1.23.3
strategy:
matrix:
include:
- runner: ARM64
name: arm64
- runner: ubuntu-latest
name: amd64
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Register workspace path
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Check go version
run: go version
- name: Set Go paths
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@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ${{ steps.go-paths.outputs.mod_cache }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Go build cache
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: ${{ steps.go-paths.outputs.build_cache }}
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
- name: Download Go Modules
run: go mod download
- name: Codegen
run: make verify-codegen
- name: Manifests
run: make verify-manifests
- name: Mockgen
run: make verify-mockgen
- name: Build
run: ARCH=${{ matrix.name }} make build
- name: Test
run: ARCH=${{ matrix.name }} make test
statics:
name: Static Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
- uses: golangci/golangci-lint-action@v6
with:
version: v1.60