-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Consul acceptance tests running against OpenShift cluster | ||
name: OpenShift Acceptance Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'anita/openshift_testing_ci' | ||
# schedule: | ||
# # Run on Monday (1),Wednesday (3),and Friday (5) at 6:00 AM UTC, 1:00 AM EST, 10:00 PM PST | ||
# - cron: '0 6 * * 1,3,5' | ||
|
||
jobs: | ||
openshift: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Helm | ||
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0 | ||
with: | ||
version: 3.9.4 | ||
|
||
- name: Install Podman | ||
run: | | ||
. /etc/os-release | ||
echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list | ||
curl -fsSL "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key" | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/libcontainers.gpg | ||
sudo apt-get update | ||
sudo apt-get -y upgrade | ||
sudo apt-get -y install podman | ||
- name: Setup OpenShift Client and kubectl | ||
run: | | ||
curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz | sudo tar -xz -C /usr/local/bin | ||
sudo chmod +x /usr/local/bin/oc /usr/local/bin/kubectl | ||
- name: Install and Run MicroShift cluster | ||
run: | | ||
sudo podman run -d --name microshift \ | ||
--privileged \ | ||
-v microshift-data:/var/lib \ | ||
-p 6443:6443 \ | ||
quay.io/microshift/microshift-aio:latest | ||
# Wait for MicroShift cluster to be ready (may need to be increased) | ||
sleep 60 | ||
# Set up kubeconfig | ||
mkdir -p ${HOME}/.kube | ||
sudo podman cp \ | ||
microshift:/var/lib/microshift/resources/kubeadmin/kubeconfig \ | ||
${HOME}/.kube/config | ||
sudo chown $(id -u):$(id -g) ${HOME}/.kube/config | ||
chmod 600 ${HOME}/.kube/config | ||
# Display cluster info | ||
kubectl cluster-info | ||
# - name: Install OVN-Kubernetes-MicroShift | ||
# run: | | ||
# # Clone the OVN-Kubernetes-MicroShift repository | ||
# git clone https://github.com/openshift/ovn-kubernetes-microshift.git | ||
# cd ovn-kubernetes-microshift | ||
|
||
# kubectl apply -f manifests/ | ||
|
||
# # Wait for OVN-Kubernetes pods to be ready | ||
# kubectl rollout status daemonset/ovnkube-node -n openshift-ovn-kubernetes --timeout=300s | ||
|
||
- name: Install Consul on MicroShift | ||
run: | | ||
helm repo add hashicorp https://helm.releases.hashicorp.com | ||
helm repo update | ||
kubectl create namespace consul | ||
helm install consul hashicorp/consul --namespace consul --set global.name=consul | ||
kubectl rollout status statefulset/consul-server -n consul --timeout=300s | ||
kubectl get pods -n consul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters