forked from epinio/epinio
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (93 loc) · 3.23 KB
/
clientsync.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
# Copyright © 2021 - 2023 SUSE LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Test the `epinio client-sync` command
name: client-sync test
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yml'
pull_request:
branches: [ main ]
paths-ignore:
- 'docs/**'
- 'README.md'
- '.goreleaser.yml'
workflow_dispatch:
# nightly
schedule:
- cron: '0 0 * * *'
env:
SETUP_GO_VERSION: '1.20.4'
GINKGO_NODES: 2
INGRESS_CONTROLLER: traefik
jobs:
client-sync-test:
runs-on: [self-hosted, epinio]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v4
timeout-minutes: 5
with:
cache: false
go-version: ${{ env.SETUP_GO_VERSION }}
- name: Setup Ginkgo Test Framework
run: go install github.com/onsi/ginkgo/v2/[email protected]
- name: Cache Tools
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/tools
key: ${{ runner.os }}-tools
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Install Tools
run: make tools-install
- name: Add Tools to PATH
run: |
echo "`pwd`/output/bin" >> $GITHUB_PATH
- name: Deploy k3d cluster with latest release of Epinio
run: |
make acceptance-cluster-setup
export KUBECONFIG=$PWD/tmp/acceptance-kubeconfig
make install-cert-manager
# Ensure the client version won't match the server one
export VSUFFIX=-dev
# Don't patch, just install the latest released version
export EPINIO_RELEASED=true
make prepare_environment_k3d
- name: Test the `epinio client-sync` command
run: |
oldVersion=$([[ $(dist/epinio-linux-amd64 version) =~ (.+)Go ]] && echo "${BASH_REMATCH[1]}" | xargs)
dist/epinio-linux-amd64 client-sync
newVersion=$([[ $(dist/epinio-linux-amd64 version) =~ (.+)Go ]] && echo "${BASH_REMATCH[1]}" | xargs)
if [ "$oldVersion" == "$newVersion" ]; then
echo "Expected $oldVersion to have been upgraded to the server version"
exit 1
else
echo "$oldVersion successfully upgraded to server version ($newVersion)"
exit 0
fi
- name: Cleanup k3d cluster
if: always()
run: make acceptance-cluster-delete
- name: Clean all
if: ${{ github.event_name == 'schedule' }}
uses: colpal/actions-clean@v1