forked from karmada-io/karmada
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (99 loc) · 4.06 KB
/
cli.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
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
name: CLI
on:
# Run this workflow every time a new commit pushed to upstream/fork repository.
# Run workflow on fork repository will help contributors find and resolve issues before sending a PR.
push:
# Exclude branches created by Dependabot to avoid triggering current workflow
# for PRs initiated by Dependabot.
branches-ignore:
- 'dependabot/**'
pull_request:
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
concurrency:
group: ${{ github.workflow }}-${{ github.actor }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # Required to check out the code
jobs:
init:
name: init
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Here support the latest three minor releases of Kubernetes, this can be considered to be roughly
# the same as the End of Life of the Kubernetes release: https://kubernetes.io/releases/
# Please remember to update the CI Schedule Workflow when we add a new version.
k8s: [ v1.29.0, v1.30.0, v1.31.0 ]
steps:
- name: checkout code
uses: actions/checkout@v4
with:
# Number of commits to fetch. 0 indicates all history for all branches and tags.
# We need to guess version via git tags.
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: run karmadactl init test
run: |
export CLUSTER_VERSION=kindest/node:${{ matrix.k8s }}
# init e2e environment
hack/cli-testing-environment.sh
# run a single e2e
export KUBECONFIG=${HOME}/karmada/karmada-apiserver.config
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo
ginkgo -v --race --trace -p --focus="[BasicPropagation] propagation testing deployment propagation testing" ./test/e2e/
- name: export logs
if: always()
run: |
export ARTIFACTS_PATH=${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/
mkdir -p $ARTIFACTS_PATH
mkdir -p $ARTIFACTS_PATH/karmada-host
kind export logs --name=karmada-host $ARTIFACTS_PATH/karmada-host
- name: upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: karmadactl_test_logs_${{ matrix.k8s }}
path: ${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/
init-config:
name: init with config file
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# Latest three minor releases of Kubernetes
k8s: [ v1.29.0, v1.30.0, v1.31.0 ]
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: run karmadactl init with config file test
run: |
export CLUSTER_VERSION=kindest/node:${{ matrix.k8s }}
# Run custom test for workload configuration deployment
hack/cli-testing-init-with-config.sh
# run a single e2e
export KUBECONFIG=${HOME}/karmada/karmada-apiserver.config
GO111MODULE=on go install github.com/onsi/ginkgo/v2/ginkgo
ginkgo -v --race --trace -p --focus="[BasicPropagation] propagation testing deployment propagation testing" ./test/e2e/
- name: export logs for config test
if: always()
run: |
export ARTIFACTS_PATH=${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config
mkdir -p $ARTIFACTS_PATH
mkdir -p $ARTIFACTS_PATH/karmada-host
kind export logs --name=karmada-host $ARTIFACTS_PATH/karmada-host
- name: upload config test logs
if: always()
uses: actions/upload-artifact@v4
with:
name: karmadactl_config_test_logs_${{ matrix.k8s }}
path: ${{ github.workspace }}/karmadactl-test-logs/${{ matrix.k8s }}/config/