Skip to content

[v2.7] GH Actions migration #38

[v2.7] GH Actions migration

[v2.7] GH Actions migration #38

name: default-linux-amd64
on: [pull_request]
jobs:
build-pr:
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
# runs-on: ubuntu-latest
container: registry.suse.com/bci/golang:1.20
env:
CATTLE_HELM_VERSION: v2.16.8-rancher2
CATTLE_MACHINE_VERSION: v0.15.0-rancher109
CATTLE_K3S_VERSION: v1.27.10+k3s2
ARCH: amd64
HELM_VERSION: v3.12.3
KUSTOMIZE_VERSION: v5.0.1
HELM_UNITTEST_VERSION: 0.3.2
K3D_VERSION: v5.4.6
CATTLE_KDM_BRANCH: dev-v2.7
HELM_URL_V2: https://github.com/rancher/helm/releases/downloadv/2.16.8-rancher2/rancher-helm
HELM_URL_V3: https://get.helm.sh/helm-v3.12.3-linux-amd64.tar.gz
TILLER_URL: https://github.com/rancher/helm/releases/download/2.16.8-rancher2/rancher-tiller
KUSTOMIZE_URL: https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.0.1/kustomize_v5.0.1_linux_amd64.tar.gz
steps:
- name: Install Dependencies
run: |
zypper -n install gcc binutils glibc-devel-static ca-certificates git-core wget curl unzip tar vim less file xz gzip sed gawk iproute2 iptables jq skopeo
zypper install -y -f docker && rpm -e --nodeps --noscripts containerd
curl -sLf https://github.com/rancher/machine/releases/download/${CATTLE_MACHINE_VERSION}/rancher-machine-${ARCH}.tar.gz | tar xvzf - -C /usr/bin
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.0; \
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/spectrometer/master/install.sh | sh; \
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.12.0
curl -sLf ${KUSTOMIZE_URL} | tar -xzf - -C /usr/bin
curl -sLf ${HELM_URL_V2} -o /usr/bin/rancher-helm && \
curl -sLf ${TILLER_URL} -o /usr/bin/rancher-tiller && \
chmod +x /usr/bin/rancher-helm /usr/bin/rancher-tiller && \
ln -s /usr/bin/rancher-helm /usr/bin/helm && \
ln -s /usr/bin/rancher-tiller /usr/bin/tiller && \
helm init -c --stable-repo-url https://charts.helm.sh/stable/
mkdir /usr/tmp && \
curl ${HELM_URL_V3} | tar xvzf - --strip-components=1 -C /usr/tmp/ && \
mv /usr/tmp/helm /usr/bin/helm_v3 && \
chmod +x /usr/bin/kustomize
zypper -n install python311-pip python311-base python311 python311-devel python311-tox libffi-devel libopenssl-devel
helm_v3 plugin install https://github.com/helm-unittest/helm-unittest.git --version ${HELM_UNITTEST_VERSION};
git config --global --add safe.directory /__w/rancher/rancher
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Validate
run: ./scripts/validate
- name: Build Rancher
run: ./scripts/build
- name: Package
run: ./scripts/package
- name: Test
run: ./scripts/test