Skip to content

Add openshift workflow yaml #40

Add openshift workflow yaml

Add openshift workflow yaml #40

# 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:
test-consul-on-openshift:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0
- name: Install OpenShift Tools
uses: redhat-actions/openshift-tools-installer@v1
with:
crc: latest
oc: "3"
- name: Verify installations
run: |
crc version
oc version
- name: Setup CRC dependencies
run: |
sudo apt-get update
sudo apt-get install -y qemu-kvm libvirt-daemon libvirt-daemon-system network-manager
newgrp libvirt
virt-manager
- name: Setup and start CRC
run: |
crc config set consent-telemetry no
crc setup
crc start --memory 13312 --cpus 4 --yes
- name: Verify CRC status
run: |
crc status
eval $(crc oc-env)
oc login -u developer -p developer https://api.crc.testing:6443
oc get nodes
- name: Setup helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: 'v3.9.4'
- name: Wait for Consul to be ready
run: |
oc wait --for=condition=ready pod -l app=consul --timeout=300s
- name: Run Acceptance Tests
run: |
# Add your Consul tests here
oc exec $(oc get pod -l app=consul -o jsonpath="{.items[0].metadata.name}") -- consul members
- name: Cleanup
if: always()
run: |
helm uninstall consul
crc stop
crc delete -f