Skip to content

Test Branches

Test Branches #32

Workflow file for this run

# Manually test code on differnt banches. Meant to test changes across multiple services
name: Test Branches
on:
workflow_dispatch:
inputs:
webpack:
default: update
type: choice
options:
- update
- dev
branches:
description: "Branches to test with (JSON) { ab_repo_name: mybranch, ... }"
type: string
default: "{}"
env:
appbuilder_platform_service: ${{ fromJson(inputs.branches).appbuilder_platform_service }}
appbuilder_class_core: ${{ fromJson(inputs.branches).appbuilder_class_core }}
ab_service_config: ${{ fromJson(inputs.branches).ab_service_config }}
ab_service_api_sails: ${{ fromJson(inputs.branches).ab_service_api_sails }}
ab_service_tenant_manager: ${{ fromJson(inputs.branches).ab_service_tenant_manager }}
ab_service_notification_email: ${{ fromJson(inputs.branches).ab_service_notification_email }}
ab_service_log_manager: ${{ fromJson(inputs.branches).ab_service_log_manager }}
ab_service_relay: ${{ fromJson(inputs.branches).ab_service_relay }}
ab_runtime: ${{ fromJson(inputs.branches).ab_runtime }}
plugin_ABDesigner: ${{ fromJson(inputs.branches).plugin_ABDesigner }}
ab_service_web: ${{ fromJson(inputs.branches).ab_service_web }}
ab_service_appbuilder: ${{ fromJson(inputs.branches).ab_service_appbuilder }}
ab_service_process_manager: ${{ fromJson(inputs.branches).ab_service_process_manager }}
ab_service_custom_reports: ${{ fromJson(inputs.branches).ab_service_custom_reports }}
ab_service_user_manager: ${{ fromJson(inputs.branches).ab_service_user_manager }}
ab_service_definition_manager: ${{ fromJson(inputs.branches).ab_service_definition_manager }}
ab_service_file_processor: ${{ fromJson(inputs.branches).ab_service_file_processor }}
ab_platform_web: ${{ fromJson(inputs.branches).ab_platform_web }}
jobs:
prep:
# Generate a list of services affected
runs-on: ubuntu-latest
outputs:
services: ${{ steps.ab_service_config.outputs.s }}${{ steps.ab_service_api_sails.outputs.s }}${{ steps.ab_service_tenant_manager.outputs.s }}${{ steps.ab_service_notification_email.outputs.s }}${{ steps.ab_service_log_manager.outputs.s }}${{ steps.ab_service_relay.outputs.s }}${{ steps.ab_service_appbuilder.outputs.s }}${{ steps.ab_service_process_manager.outputs.s }}${{ steps.ab_service_custom_reports.outputs.s }}${{ steps.ab_service_user_manager.outputs.s }}${{ steps.ab_service_definition_manager.outputs.s }}${{ steps.ab_service_file_processor.outputs.s }}${{ steps.ab_service_web.outputs.s }}
steps:
- run: echo "::set-output name=s::ab_service_config "
id: ab_service_config
if: ${{ env.ab_service_config }}
- run: echo "::set-output name=s::ab_service_api_sails "
id: ab_service_api_sails
if: ${{ env.ab_service_api_sails }}
- run: echo "::set-output name=s::ab_service_tenant_manager "
id: ab_service_tenant_manager
if: ${{ env.ab_service_tenant_manager }}
- run: echo "::set-output name=s::ab_service_notification_email "
id: ab_service_notification_email
if: ${{ env.ab_service_notification_email }}
- run: echo "::set-output name=s::ab_service_log_manager "
id: ab_service_log_manager
if: ${{ env.ab_service_log_manager }}
- run: echo "::set-output name=s::ab_service_relay "
id: ab_service_relay
if: ${{ env.ab_service_relay }}
- run: echo "::set-output name=s::ab_service_appbuilder "
id: ab_service_appbuilder
if: ${{ env.ab_service_appbuilder || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_process_manager "
id: ab_service_process_manager
if: ${{ env.ab_service_process_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_custom_reports "
id: ab_service_custom_reports
if: ${{ env.ab_service_custom_reports || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_user_manager "
id: ab_service_user_manager
if: ${{ env.ab_service_user_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_definition_manager "
id: ab_service_definition_manager
if: ${{ env.ab_service_definition_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_file_processor "
id: ab_service_file_processor
if: ${{ env.ab_service_file_processor || env.appbuilder_platform_service || env.appbuilder_class_core }}
- run: echo "::set-output name=s::ab_service_web "
id: ab_service_web
if: ${{ env.ab_service_web || env.ab_platform_web || env.appbuilder_class_core || env.plugin_ABDesigner }}
cypress-test:
runs-on: ubuntu-latest
needs: prep
steps:
#1. Checkout Repos
# ab_service_config
- name: Checkout ab_service_config
if: ${{ env.ab_service_config }}
uses: actions/checkout@v3
with:
path: ab_service_config
repository: digi-serve/ab_service_config
ref: ${{ env.ab_service_config || 'develop' }}
# ab_service_api_sails
- name: Checkout ab_service_api_sails
if: ${{ env.ab_service_api_sails }}
uses: actions/checkout@v3
with:
path: ab_service_api_sails
repository: digi-serve/ab_service_api_sails
ref: ${{ env.ab_service_api_sails || 'develop' }}
# ab_service_tenant_manager
- name: Checkout ab_service_tenant_manager
if: ${{ env.ab_service_tenant_manager }}
uses: actions/checkout@v3
with:
path: ab_service_tenant_manager
repository: digi-serve/ab_service_tenant_manager
ref: ${{ env.ab_service_tenant_manager || 'develop' }}
# ab_service_notification_email
- name: Checkout ab_service_notification_email
if: ${{ env.ab_service_notification_email }}
uses: actions/checkout@v3
with:
path: ab_service_notification_email
repository: digi-serve/ab_service_notification_email
ref: ${{ env.ab_service_notification_email || 'develop' }}
# ab_service_log_manager
- name: Checkout ab_service_log_manager
if: ${{ env.ab_service_log_manager }}
uses: actions/checkout@v3
with:
path: ab_service_log_manager
repository: digi-serve/ab_service_log_manager
ref: ${{ env.ab_service_log_manager || 'develop' }}
# ab_service_relay
- name: Checkout ab_service_relay
if: ${{ env.ab_service_relay }}
uses: actions/checkout@v3
with:
path: ab_service_relay
repository: digi-serve/ab_service_relay
ref: ${{ env.ab_service_relay || 'develop' }}
# plugin_ABDesigner
- name: Checkout plugin_ABDesigner
if: ${{ env.plugin_ABDesigner }}
uses: actions/checkout@v3
with:
path: plugin/plugin_ABDesigner
repository: digi-serve/plugin_ABDesigner
ref: ${{ env.plugin_ABDesigner || 'master' }}
# ab_service_appbuilder
- name: Checkout ab_service_appbuilder
if: ${{ env.ab_service_appbuilder || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_appbuilder
repository: digi-serve/ab_service_appbuilder
ref: ${{ env.ab_service_appbuilder || 'develop' }}
- name: Checkout ab_service_appbuilder > AppBuilder
if: ${{ env.ab_service_appbuilder || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_appbuilder/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_appbuilder > AppBuilder > core
if: ${{ env.ab_service_appbuilder || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_appbuilder/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_process_manager
- name: Checkout ab_service_process_manager
if: ${{ env.ab_service_process_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_process_manager
repository: digi-serve/ab_service_process_manager
ref: ${{ env.ab_service_process_manager || 'develop' }}
- name: Checkout ab_service_process_manager > AppBuilder
if: ${{ env.ab_service_process_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_process_manager/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_process_manager > AppBuilder > core
if: ${{ env.ab_service_process_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_process_manager/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_custom_reports
- name: Checkout ab_service_custom_reports
if: ${{ env.ab_service_custom_reports || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_custom_reports
repository: digi-serve/ab_service_custom_reports
ref: ${{ env.ab_service_custom_reports || 'develop' }}
- name: Checkout ab_service_custom_reports > AppBuilder
if: ${{ env.ab_service_custom_reports || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_custom_reports/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_custom_reports > AppBuilder > core
if: ${{ env.ab_service_custom_reports || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_custom_reports/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_user_manager
- name: Checkout ab_service_user_manager
if: ${{ env.ab_service_user_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_user_manager
repository: digi-serve/ab_service_user_manager
ref: ${{ env.ab_service_user_manager || 'develop' }}
- name: Checkout ab_service_user_manager > AppBuilder
if: ${{ env.ab_service_user_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_user_manager/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_user_manager > AppBuilder > core
if: ${{ env.ab_service_user_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_user_manager/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_definition_manager
- name: Checkout ab_service_definition_manager
if: ${{ env.ab_service_definition_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_definition_manager
repository: digi-serve/ab_service_definition_manager
ref: ${{ env.ab_service_definition_manager || 'develop' }}
- name: Checkout ab_service_definition_manager > AppBuilder
if: ${{ env.ab_service_definition_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_definition_manager/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_definition_manager > AppBuilder > core
if: ${{ env.ab_service_definition_manager || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_definition_manager/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_file_processor
- name: Checkout ab_service_file_processor
if: ${{ env.ab_service_file_processor || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_file_processor
repository: digi-serve/ab_service_file_processor
ref: ${{ env.ab_service_file_processor || 'develop' }}
- name: Checkout ab_service_file_processor > AppBuilder
if: ${{ env.ab_service_file_processor || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_file_processor/AppBuilder
repository: digi-serve/appbuilder_platform_service
ref: ${{ env.appbuilder_platform_service || 'master' }}
- name: Checkout ab_service_file_processor > AppBuilder > core
if: ${{ env.ab_service_file_processor || env.appbuilder_platform_service || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_service_file_processor/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_platform_web
- name: Checkout ab_platform_web
if: ${{ env.ab_platform_web || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_platform_web
repository: digi-serve/ab_platform_web
ref: ${{ env.ab_platform_web || 'master' }}
- name: Checkout ab_platform_web > AppBuilder > core
if: ${{ env.ab_platform_web || env.appbuilder_class_core }}
uses: actions/checkout@v3
with:
path: ab_platform_web/AppBuilder/core
repository: digi-serve/appbuilder_class_core
ref: ${{ env.appbuilder_class_core || 'v2' }}
# ab_service_web
- name: Checkout ab_service_web
if: ${{ env.ab_service_web || env.ab_platform_web || env.appbuilder_class_core || env.plugin_ABDesigner }}
uses: actions/checkout@v3
with:
path: ab_service_web
repository: digi-serve/ab_service_web
ref: ${{ env.ab_service_web || 'develop' }}
# 3. Run Webpack
- name: Rename ab_service_web > web
run: mv ab_service_web web
if: ${{ env.ab_platform_web || env.appbuilder_class_core || env.plugin_ABDesigner}}
- run: npm i
working-directory: ./ab_platform_web
if: ${{ env.ab_platform_web || env.appbuilder_class_core }}
- name: Webpack
run: npm run build:${{ inputs.webpack }}
working-directory: ./ab_platform_web
if: ${{ env.ab_platform_web || env.appbuilder_class_core }}
- run: npm i
working-directory: ./plugin/plugin_ABDesigner
if: ${{ env.plugin_ABDesigner }}
- name: Webpack
run: npm run build:${{ inputs.webpack }}
working-directory: ./plugin/plugin_ABDesigner
if: ${{ env.plugin_ABDesigner }}
- name: Rename web > ab_service_web
if: ${{ env.ab_platform_web || env.appbuilder_class_core || env.plugin_ABDesigner}}
run: mv web ab_service_web
# 4. Install AB
- uses: digi-serve/ab-install-action@v1
with:
port: 80
folder: ab
repository: digi-serve/ab_service_web
runtime: ${{ env.ab_runtime }}
# 5. Run Tests
- name: Checkout Kitchen Sink
uses: actions/checkout@v3
with:
repository: digi-serve/kitchensink_app
path: ab/test/e2e/cypress/e2e/kitchensink_app
# These next steps are to save our ablogs to file
- run: npm install pm2@latest -g
working-directory: ./ab
- name: Save Logs
run: pm2 start ./logs.js -- --toFile logs/ABServices.log
working-directory: ./ab
- name: Wait for AB
uses: ifaxity/wait-on-action@v1
with:
resource: http://localhost/
timeout: 300000
- name: Run Cypress Tests
run: npm run test:e2e:app -- --browser chrome
working-directory: ./ab
- uses: actions/upload-artifact@v2
if: failure()
with:
name: cypress-screenshots
path: ./ab/test/e2e/cypress/screenshots
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ABServices.log
path: ./ab/logs/ABServices.log