@@ -42,69 +42,99 @@ permissions:
4242 contents : write
4343
4444jobs :
45+ build-rancher-manager :
46+ runs-on : ubuntu-latest
47+ steps :
48+ - name : Checkout rancher repository
49+ uses : actions/checkout@v4
50+ with :
51+ repository : rancher/rancher
52+ ref : v2.8.3
53+ - name : setup Go
54+ uses : actions/setup-go@v5
55+ with :
56+ go-version : ' 1.22'
57+ - name : Build rancher
58+ run : go build -o ./bin/rancher ./main.go && chmod +x ./bin/rancher
59+ - name : Upload artifact
60+ uses : actions/upload-artifact@v4
61+ with :
62+ name : rancher-manager-build-artifact
63+ path : ./bin/rancher
4564 e2e-helm-project-operator :
65+ needs : [
66+ build-rancher-manager
67+ ]
4668 runs-on : ubuntu-latest
4769 strategy :
4870 matrix :
4971 k3s_version :
50- # k3d version list k3s | sed 's/+/-/' | sort -h
5172 - ${{ github.event.inputs.k3s_version || 'v1.27.7-k3s2' }}
5273 steps :
53- -
54- uses : actions/checkout@v3
74+ - uses : actions/checkout@v4
5575 with :
5676 fetch-depth : 0
57- -
58- name : Install mikefarah/yq
77+ - name : Fetch build artifacts
78+ uses : actions/download-artifact@v4
79+ with :
80+ name : rancher-manager-build-artifact
81+ path : ./bin/rancher
82+ - name : Debug artifacts
83+ run : ls -l ./bin
84+ - name : Install mikefarah/yq
5985 run : |
6086 sudo wget https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq;
61- -
62- name : setup Go
87+ - name : setup Go
6388 uses : actions/setup-go@v5
6489 with :
6590 go-version : ' 1.22'
66- -
67- name : Perform CI
91+ - name : Perform CI
6892 run : |
69- REPO=${REPO} TAG=${TAG} ./scripts/build;
7093 REPO=${REPO} TAG=${TAG} ./scripts/package;
71- -
72- name : Provision k3d Cluster
73- uses : AbsaOSS/k3d-action@v2
74- # k3d will automatically create a network named k3d-test-cluster-1 with the range 172.18.0.0/16
75- with :
76- cluster-name : " e2e-ci-helm-project-operator"
77- args : >-
78- --agents 1
79- --network "nw01"
80- --image docker.io/rancher/k3s:${{matrix.k3s_version}}
81- -
82- name : Import Images Into k3d
83- run : |
84- k3d image import ${REPO}/helm-project-operator:${TAG} -c e2e-ci-helm-project-operator;
85- -
86- name : Setup kubectl context
87- run : |
88- kubectl config use-context k3d-e2e-ci-helm-project-operator;
94+ - name : Install k3d
95+ run : ./.github/workflows/e2e/scripts/install-k3d.sh
96+ - name : Setup k3d cluster
97+ run : CLUSTER_NAME=e2e-ci-hpo ./.github/workflows/e2e/scripts/setup-k3d-cluster.sh
98+ - name : Bootstrap cluster
99+ run : CATTLE_DEV_MODE=30 CATTLE_BOOTSTRAP_PASSWORD=admin ./bin/rancher --trace=false --add-local=true --no-cacerts
100+ # name: Provision k3d Cluster
101+ # uses: AbsaOSS/k3d-action@v2
102+ # # k3d will automatically create a network named k3d-test-cluster-1 with the range 172.18.0.0/16
103+ # with:
104+ # cluster-name: "e2e-ci-helm-project-operator"
105+ # args: >-
106+ # --agents 1
107+ # --network "nw01"
108+ # --image docker.io/rancher/k3s:${{matrix.k3s_version}}
109+ # -
110+ # name: Import Images Into k3d
111+ # run: |
112+ # k3d image import ${REPO}/helm-project-operator:${TAG} -c e2e-ci-helm-project-operator;
113+ # -
114+ # name: Setup kubectl context
115+ # run: |
116+ # kubectl config use-context k3d-e2e-ci-helm-project-operator;
89117 -
90118 name : Set Up Tmate Debug Session
91119 if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.enable_tmate == 'true' }}
92120 uses : mxschmitt/action-tmate@v3
93121 timeout-minutes : 15
94122 with :
95- limit-access-to-actor : true
123+ limit-access-to-actor : true
124+
125+ # -
126+ # name: Install rancher manager
127+ # run: ./.github/workflows/e2e/scripts/install-rancher.sh;
128+ # -
129+ # name: Validate rancher manager
130+ # run: ./.github/workflows/e2e/scripts/validate-rancher.sh;
96131 -
97132 name : Install Helm Project Operator
98133 run : ./.github/workflows/e2e/scripts/install-helm-project-operator.sh;
99134 -
100135 name : Check if Helm Project Operator is up
101136 run : ./.github/workflows/e2e/scripts/validate-helm-project-operator.sh;
102- -
103- name : Install rancher manager
104- run : ./.github/workflows/e2e/scripts/install-rancher.sh;
105- -
106- name : Validate rancher manager
107- run : ./.github/workflows/e2e/scripts/validate-rancher.sh;
137+
108138 -
109139 name : Check if Project Registration Namespace is auto-created on namespace detection
110140 run : ./.github/workflows/e2e/scripts/create-project-namespace.sh;
0 commit comments