Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Commit

Permalink
Testing reusable flow 45
Browse files Browse the repository at this point in the history
  • Loading branch information
lholota committed May 22, 2023
1 parent ba4c3af commit 302e12c
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 22 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI

on:
push:

jobs:
e2e-local-lab:
uses: ./.github/workflows/run-e2e-local.yml
with:
environment: lab
gitref: ${{ env.GITHUB_REF }}
secrets:
sops_age_key: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}

e2e-remote-lab:
uses: ./.github/workflows/run-e2e-remote.yml
with:
environment: lab
gitref: ${{ env.GITHUB_REF }}
secrets:
sops_age_key: ${{ secrets.SOPS_AGE_PRIVATE_KEY }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@ on:
environment:
required: true
type: string
branch:
gitref:
required: false
type: string
default: feat/v1 # TODO: Change to master
default: master
secrets:
sops_age_key:
required: true

# TODO: Set token perms

jobs:
e2e-preparations:
Expand All @@ -25,7 +23,7 @@ jobs:
uses: actions/checkout@v3.5.2
with:
repository: homecentr/e2e
ref: refs/heads/${{ inputs.branch }}
ref: refs/heads/${{ inputs.gitref }}
path: e2e

- name: Load variables
Expand All @@ -52,7 +50,7 @@ jobs:
uses: actions/checkout@v3.5.2
with:
repository: homecentr/e2e
ref: refs/heads/${{ inputs.branch }}
ref: refs/heads/${{ inputs.gitref }}
path: e2e

- name: Install dependencies
Expand All @@ -65,5 +63,3 @@ jobs:
WEBDRIVER_PORT: ${{ job.services.webdriver-chrome.ports[4444] }}
SOPS_AGE_KEY: ${{ secrets.sops_age_key }}
SCREENSHOTS_ENABLED: "false"

# TODO: Run remote tests
65 changes: 65 additions & 0 deletions .github/workflows/run-e2e-remote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
workflow_call:
inputs:
environment:
required: true
type: string
gitref:
required: false
type: string
default: master
secrets:
sops_age_key:
required: true

jobs:
e2e-preparations:
runs-on: [ self-hosted ]
outputs:
dns1: ${{ steps.vars.outputs.DNS1 }}
dns2: ${{ steps.vars.outputs.DNS2 }}
steps:
- name: Check out e2e repository
uses: actions/checkout@v3.5.2
with:
repository: homecentr/e2e
ref: refs/heads/${{ inputs.gitref }}
path: e2e

- name: Load variables
id: vars
run: cat ./e2e/environments/remote.env >> "$GITHUB_OUTPUT"

e2e-tests-local:
runs-on: [ self-hosted ]
needs: [ e2e-preparations ]
services:
webdriver-chrome:
image: selenium/standalone-chrome
ports:
- 4444
- 7900
env:
VNC_NO_PASSWORD: 1
options: --shm-size=2g --dns=${{ needs.e2e-preparations.outputs.dns1 }} --dns=${{ needs.e2e-preparations.outputs.dns2 }}
steps:
- name: Print debug link
run: echo "::info::http://$HOST_IP:${{ job.services.webdriver-chrome.ports[7900] }}"

- name: Check out e2e repository
uses: actions/checkout@v3.5.2
with:
repository: homecentr/e2e
ref: refs/heads/${{ inputs.gitref }}
path: e2e

- name: Install dependencies
run: cd e2e && yarn

- name: Run tests
run: cd e2e && yarn test:remote:${{ inputs.environment }}
env:
WEBDRIVER_HOST: host.docker.internal
WEBDRIVER_PORT: ${{ job.services.webdriver-chrome.ports[4444] }}
SOPS_AGE_KEY: ${{ secrets.sops_age_key }}
SCREENSHOTS_ENABLED: "false"
14 changes: 0 additions & 14 deletions .github/workflows/run-lab.yml

This file was deleted.

0 comments on commit 302e12c

Please sign in to comment.