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

add odo init image test for PRs #102

Merged
Merged
Changes from 3 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
117 changes: 117 additions & 0 deletions .github/workflows/odo-init-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# This workflow will build and test odo-init-image and setup necessary to run integration tests
#
# Env required for this workflow:
#
# 1. Setup secrets in your repository: IBM_CLOUD_API_KEY, SSH_PRIVATE_KEY, REGISTRY_PASSWORD
# 2. Change the values for the IC_REGION
name: odo-init-image-test
on: [ push ]

env:
GITHUB_SHA: ${{ github.sha }}
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
IBM_CLOUD_REGION: eu-de
OPENSHIFT_CLUSTER_ENDPOINT: ${{ secrets.OPENSHIFT_CLUSTER_ENDPOINT }}
KUBE_CLUSTER_ID: ${{ secrets.IBM_CLOUD_KUBE_CLUSTER_ID }}

jobs:
build:
name: odo-init-image-test
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2

- name: Add Cleanup Tag
run: echo "LABEL quay.expires-after=20h" >> Dockerfile

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: odo-init-pr
tags: ${{ github.sha }}
containerfiles: |
./Dockerfile

# Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in,
# in which case 'username' and 'password' can be omitted.
- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/odo-dev
username: odo-dev+odo_init_tester
password: ${{ secrets.REGISTRY_PASSWORD }}

- name: Print image url
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: echo $ODO_BOOTSTRAPPER_IMAGE

#run: echo "$ODO_BOOTSTRAPPER_IMAGE \n\tImage pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
- name: Checkout odo repo
uses: actions/checkout@v2
with:
repository: redhat-developer/odo
path: odo

- name: Install oc
uses: redhat-actions/oc-installer@v1

- name: Connect to Openshift cluster
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ env.OPENSHIFT_CLUSTER_ENDPOINT }}
openshift_username: apikey
openshift_password: ${{ env.IBM_CLOUD_API_KEY }}

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15.1'

- name: Build odo
run: make install
working-directory: ./odo

- name: Run Integration tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: |
make test-integration
working-directory: ./odo

- name: Run Devfile Integration tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: |
make test-integration-devfile
working-directory: ./odo
- name: Run Operator Hub Integration tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: |
make test-operator-hub
working-directory: ./odo
- name: Run Login/logout Integration tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
SKIP_USER_LOGIN_TESTS: true
run: |
make test-cmd-login-logout
working-directory: ./odo
- name: Run Command Integration tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: |
make test-cmd-project
working-directory: ./odo
- name: Run e2e tests
env:
ODO_BOOTSTRAPPER_IMAGE: "quay.io/odo-dev/${{ steps.build-image.outputs.image }}:${{ github.sha }}"
run: |
make test-e2e-all
working-directory: ./odo