forked from Saremox/redis-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
115 lines (107 loc) · 3.02 KB
/
Copy pathci.yaml
File metadata and controls
115 lines (107 loc) · 3.02 KB
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
name: CI
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Build redis-operator
run: go build -v ./cmd/redisoperator
- name: Build redis-instance
run: go build -v ./cmd/instance
check:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.6.0
args: --timeout=15m
unit-test:
name: Unit test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: make ci-unit-test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: false
integration-test:
name: Integration test
runs-on: ubuntu-22.04
needs: [check, unit-test]
strategy:
matrix:
kubernetes: [1.32.0, 1.33.1, 1.34.0]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install conntrack
run: sudo apt-get install -y conntrack
- uses: medyagh/setup-minikube@v0.0.21
with:
kubernetes-version: ${{ matrix.kubernetes }}
minikube-version: 1.37.0
driver: none
- name: Build operator image for tests
run: docker build -t ghcr.io/buildio/redis-operator:test -f docker/app/Dockerfile .
- name: Add redisfailover CRD
run: kubectl create -f manifests/databases.spotahome.com_redisfailovers.yaml
- run: make ci-integration-test
chart-test:
name: Chart testing
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.7.2
- name: Helm test
run: make helm-test
docker:
name: Docker build
runs-on: ubuntu-latest
needs: [build, unit-test]
steps:
- uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# This is kinda hacky, but it's the simplest way to get the lowercase repo name https://github.com/orgs/community/discussions/25768
- name: downcase REPO
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: ./docker/app/Dockerfile
platforms: linux/amd64,linux/arm64
push: false
tags: ghcr.io/${{ env.REPO }}:${{ github.sha }}