Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: chore: migrate crc-e2e #35

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/crc-e2e-builder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: crc-e2e-builder

on:
push:
tags: [ 'crc-e2e-v*' ]
pull_request:
branches: [ main ]
paths: ['crc-e2e/**', '.github\/workflows\/crc-e2e*' ]

jobs:
build:
name: build
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

# Allow emulation for building multi arch images
- name: Prepare runner
shell: bash
run: |
sudo apt-get install -y qemu-user-static

- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
env:
CRC_E2E: ghcr.io/crc-org/ci-crc-e2e
CRC_E2E_V: pr-${{ github.event.number }}
run: |
make crc-e2e-oci-build
make crc-e2e-oci-save
echo "image=${CRC_E2E}:${CRC_E2E_V}" >> "$GITHUB_ENV"

- name: Build image for Release
if: ${{ github.event_name == 'push' }}
run: |
make crc-e2e-oci-build
make crc-e2e-oci-save
echo "image=$(sed -n 1p crc-e2e/release-info):v$(sed -n 2p crc-e2e/release-info)" >> "$GITHUB_ENV"

- name: Create image metadata
run: |
echo ${{ env.image }} > crc-e2e-image
echo ${{ github.event_name }} > crc-e2e-build-event

- name: Upload crc-e2e
uses: actions/upload-artifact@v4
with:
name: crc-e2e
path: crc-e2e*

tkn-check:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Template tkn for PR
if: ${{ github.event_name == 'pull_request' }}
env:
CRC_E2E: ghcr.io/crc-org/ci-crc-e2e
CRC_E2E_V: pr-${{ github.event.number }}
run: |
make crc-e2e-tkn-create

- name: Check tkn specs
run: |
if [[ ! -f crc-e2e/tkn/crc-e2e-installer.yaml ]]; then
exit 1
fi
if [[ ! -f crc-e2e/tkn/crc-e2e.yaml ]]; then
exit 1
fi
# Check if version is in sync

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1

# https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html
- name: Deploy min supported tekton version
run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml

- name: Deploy tasks
run: |
kubectl apply -f crc-e2e/tkn/crc-e2e-installer.yaml
kubectl apply -f crc-e2e/tkn/crc-e2e.yaml

- name: Upload crc-e2e-tkn
uses: actions/upload-artifact@v4
with:
name: crc-e2e-tkn
path: crc-e2e/tkn/crc-e2e*
72 changes: 72 additions & 0 deletions .github/workflows/crc-e2e-pusher.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: crc-e2e-pusher

on:
workflow_run:
workflows: crc-e2e-builder
types:
- completed

jobs:
push:
name: push
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- name: Download crc-e2e assets
uses: actions/download-artifact@v4
with:
name: crc-e2e
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Get crc-e2e build informaiton
run: |
echo "source_event=$(cat crc-e2e-build-event)" >> "$GITHUB_ENV"
echo "image=$(cat crc-e2e-image)" >> "$GITHUB_ENV"

- name: Log in to ghcr.io
if: ${{ env.source_event == 'pull_request' }}
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in quay.io
if: ${{ env.source_event == 'push' }}
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}

- name: Push crc-e2e
run: |
podman load -i crc-e2e-linux.tar
podman push ${{ env.image }}-linux
podman load -i crc-e2e-windows.tar
podman push ${{ env.image }}-windows
podman load -i crc-e2e-darwin.tar
podman push ${{ env.image }}-darwin

- name: Download crc-e2e-tkn assets
uses: actions/download-artifact@v4
with:
name: crc-e2e-tkn
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}

- name: Push crc-e2e-tkn
env:
TKN_VERSION: '0.37.0'
run: |
curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz"
tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn
./tkn bundle push ${{ env.image }}-tkn \
-f crc-e2e-installer.yaml \
-f crc-e2e.yaml


5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ endif
$(TOOLS_BINDIR)/tkn bundle push $(IMAGE)-tkn \
-f crc-builder/tkn/crc-builder-installer.yaml
-f crc-builder/tkn/crc-builder.yaml


#### crc-e2e ####


15 changes: 15 additions & 0 deletions crc-e2e/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
VERSION ?= 1.0.0
CONTAINER_MANAGER ?= podman

# Image URL to use all building/pushing image targets
IMG ?= quay.io/rhqp/crc-e2e-tkn:v${VERSION}

# Helpers
TOOLS_DIR := ./../tools
include ./../tools/tools.mk

# Create tekton task bundle
.PHONY: tkn-push
tkn-push: install-out-of-tree-tools
$(TOOLS_BINDIR)/tkn bundle push $(IMG) \
-f crc-e2e.yaml
12 changes: 12 additions & 0 deletions crc-e2e/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Overview

This task will allow to run set of tests suites for Openshift Local.

Tests available are e2e and integration.

## Prerequisites

* Tests will be run on a target host with Openshift Local already installed.
* Target host will be connected through ssh.
* In case testing a custom bundle, bundle should be already downloaded on the
bundle-location informed path for the target machine.
Loading
Loading