Skip to content

Commit

Permalink
[v0.3] [GHA] Migrate v0.3 to GHA (#385)
Browse files Browse the repository at this point in the history
* Migrate v0.3 to GHA

- backport changes to v0.5
- use k8s 1.27
- include setting capi.port -- this stopped happening with v 0.4
- rancher 2.7 chart still insists on k8s 1.26 tops
- Install rancher against an up-to-date chart.

* Revert to the original version of golangci-lint

* Back out other unrelated changes.

* Don't change the Helm version.
  • Loading branch information
ericpromislow authored Oct 29, 2024
1 parent 36ae8ac commit 72bee62
Show file tree
Hide file tree
Showing 21 changed files with 651 additions and 309 deletions.
189 changes: 0 additions & 189 deletions .drone.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
push:
branches:
- release/v*
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: CI
strategy:
matrix:
archBox:
- { arch: amd64, vmArch: x64 }
- { arch: arm64, vmArch: arm64 }
runs-on: runs-on,runner=1cpu-linux-${{ matrix.archBox.vmArch }},run-id=${{ github.run_id }}
steps:
- name : Checkout repository
# https://github.com/actions/checkout/releases/tag/v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
# https://github.com/actions/setup-go/releases/tag/v5.0.0
with:
go-version-file: 'go.mod'

- name: Checkout rancher/rancher and build the chart
run: |
mkdir -p "${{ runner.temp}}"
pushd "${{ runner.temp}}"
git clone --depth 1 -b release/v2.7 https://github.com/rancher/rancher.git rancherDir-v2.7
cd rancherDir-v2.7
./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.26.15-k3s1
ARCH: "${{ matrix.archBox.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.7-head"
VERSION: "2.7"

- name: get vars
run: cat dist/image_tag >> $GITHUB_ENV

- name: Run integration tests
run: ./.github/workflows/scripts/integration-test-ci
env:
ARCH: "${{ matrix.archBox.arch }}"
CLUSTER_NAME: webhook
IMAGE_REPO: rancher/webhook
IMAGE_TAG: "${{ env.IMAGE_TAG }}"
Loading

0 comments on commit 72bee62

Please sign in to comment.