forked from rancher/webhook
-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (94 loc) · 3.01 KB
/
Copy pathci.yaml
File metadata and controls
110 lines (94 loc) · 3.01 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
# PANDARIA: Webhook CI
name: Webhook CI
on:
push:
branches:
- release/v*
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
workflow_dispatch:
permissions:
contents: read
env:
OAUTH_TOKEN: ${{ secrets.RD_ONLY_GH_TOKEN }}
jobs:
build:
name: CI
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-24.04-arm
# runs-on: runs-on,runner=1cpu-linux-${{ matrix.archBox.vmArch }},run-id=${{ github.run_id }}
runs-on: ${{ matrix.os }}
steps:
- name : Checkout repository
# https://github.com/actions/checkout/releases/tag/v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Go
# https://github.com/actions/setup-go/releases/tag/v5.0.0
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: 'go.mod'
- name: Set arch variable
shell: bash
run: |
case "${{ runner.arch }}" in
"X64" )
echo "ARCH=amd64" >> $GITHUB_ENV
;;
"ARM64" )
echo "ARCH=arm64" >> $GITHUB_ENV
;;
esac
- name: Install dependencies
shell: bash
run: |
curl -sL https://get.helm.sh/helm-v3.13.3-linux-${ARCH}.tar.gz | sudo tar xvzf - -C /usr/local/bin --strip-components=1
curl -sL https://dl.k8s.io/v1.28.11/kubernetes-client-linux-${ARCH}.tar.gz | sudo tar xvzf - -C /usr/local/bin --strip-components=3
- name: Checkout rancher/rancher and build the chart
run: |
mkdir -p "${{ runner.temp}}"
pushd "${{ runner.temp}}"
git clone --depth 1 -b release/v2.8 https://github.com/rancher/rancher.git rancherDir-v2.8
cd rancherDir-v2.8
./scripts/chart/build chart
tar cfz "${{ runner.temp }}/rancher.tgz" -C build/chart/rancher .
popd
- name: install K3d
run: ./.github/workflows/scripts/install-k3d.sh
env:
K3D_VERSION: latest
- name: ci
run: make ci
- name: setup cluster
run: ./.github/workflows/scripts/setup-cluster.sh
env:
CLUSTER_NAME: webhook
K3S_VERSION: v1.28.11-k3s1
ARCH: "${ARCH}"
- name: import image
run: k3d image import dist/rancher-webhook-image.tar -c webhook
- name: start rancher
run: ./.github/workflows/scripts/start-rancher.sh
env:
CHART_PATH: "${{ runner.temp }}/rancher.tgz"
RANCHER_IMAGE_TAG: "v2.8-head"
VERSION: "2.8"
- name: get vars
run: cat dist/image_tag >> $GITHUB_ENV
- name: Run integration tests
run: ./.github/workflows/scripts/integration-test-ci
env:
ARCH: "${ARCH}"
CLUSTER_NAME: webhook
IMAGE_REPO: cnrancher/webhook
IMAGE_TAG: "${{ env.IMAGE_TAG }}"