Skip to content

E2E UI workflow

E2E UI workflow #3

Workflow file for this run

# This workflow is a reusable one called by other workflows
name: E2E UI workflow (template)
on:
workflow_dispatch:
# Variables to set when calling this reusable workflow
inputs:
browser:
description: Web browser to test
required: true
type: string
cypress_image:
description: Cypress docker image to use
required: true
type: string
default: cypress/browsers:node16.14.2-slim-chrome100-ff99-edge
cypress_test:
description: Scenario to test
required: true
type: string
jobs:
installation:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install K3s / Helm / Rancher
id: installation
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
HELM_VERSION: 3.12.0
K3S_VERSION: v1.25.9+k3s1
RANCHER_VERSION: 2.7.5
run: |
## Export information to other jobs
ETH_DEV=$(ip route | awk '/default via / { print $5 }')
MY_IP=$(ip a s ${ETH_DEV} | egrep -o 'inet [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | cut -d' ' -f2)
export MY_HOSTNAME=$(hostname)
echo "MY_IP=${MY_IP}" >> $GITHUB_OUTPUT
echo "MY_HOSTNAME=${MY_HOSTNAME}" >> $GITHUB_OUTPUT
make prepare-e2e-ci-rancher
outputs:
MY_HOSTNAME: ${{ steps.installation.outputs.MY_HOSTNAME }}
MY_IP: ${{ steps.installation.outputs.MY_IP }}
# # Use a Cypress container to run all tests
# cypress-tests:
# needs:
# - installation
# runs-on: self-hosted
# container:
# image: ${{ inputs.cypress_image }}
# env:
# CLUSTER_NAME: local
# RANCHER_USER: admin
# RANCHER_PASSWORD: rancherpassword
# RANCHER_URL: https://${{ needs.installation.outputs.MY_IP }}
# options: --add-host ${{ needs.installation.outputs.MY_HOSTNAME }}:${{ needs.installation.outputs.MY_IP }} --ipc=host --user 1000
# steps:
# - name: Cypress run
# uses: cypress-io/github-action@v5
# with:
# browser: ${{ inputs.browser }}
# # headless: true
# spec: |
# cypress/e2e/unit_tests/first_connexion.spec.ts
# cypress/e2e/unit_tests/${{ inputs.cypress_test }}
# config-file: cypress.config.ts
# - name: Upload Cypress screenshots
# uses: actions/upload-artifact@v3
# if: failure()
# with:
# name: cypress-screenshots-tests
# path: cypress/screenshots
# retention-days: 7
# # Test run video was always captured, so this action uses "always()" condition
# - name: Upload Cypress videos
# uses: actions/upload-artifact@v3
# if: always()
# with:
# name: cypress-videos-tests
# path: cypress/videos
# retention-days: 7
# delete-cluster:
# if: always()
# needs: [installation, cypress-tests]
# runs-on: self-hosted
# steps:
# - name: Delete k3s cluster
# if: always()
# run: |
# make clean-all
# - name: Clean all
# if: always()
# uses: colpal/actions-clean@v1