2023-03-22 13:17:19 +00:00
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
2023-08-21 14:07:49 +00:00
name : Nightly Frontend Test Main
2022-04-27 19:51:51 +00:00
on :
schedule :
- cron : '0 4 * * *'
workflow_dispatch : {}
env :
2023-06-21 15:26:27 +00:00
EMBER_PARTITION_TOTAL : 4 # Has to be changed in tandem with the matrix.partition
2022-05-09 18:57:54 +00:00
BRANCH : "main"
2023-06-21 15:26:27 +00:00
BRANCH_NAME : "main" # Used for naming artifacts
GOPRIVATE : github.com/hashicorp # Required for enterprise deps
2022-04-27 19:51:51 +00:00
jobs :
frontend-test-workspace-node :
runs-on : ubuntu-latest
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
- name : Workspace Tests
id : workspace-test
working-directory : ./ui
run : make test-workspace
- name : Node Tests
id : node-test
working-directory : ./ui/packages/consul-ui
run : make test-node
2023-08-22 14:46:03 +00:00
frontend-build-ce :
2022-04-27 19:51:51 +00:00
runs-on : ubuntu-latest
env :
JOBS : 2
CONSUL_NSPACES_ENABLED : 0
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
2023-08-22 14:46:03 +00:00
- name : Ember Build CE
id : build-ce
2022-04-27 19:51:51 +00:00
working-directory : ./ui/packages/consul-ui
run : make build-ci
2023-08-22 14:46:03 +00:00
- name : Upload CE Frontend
2024-05-14 19:49:03 +00:00
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
2022-04-27 19:51:51 +00:00
with :
2023-08-22 14:46:03 +00:00
name : frontend-ce-${{ env.BRANCH_NAME }}
2022-05-09 18:57:54 +00:00
path : ./ui/packages/consul-ui/dist
if-no-files-found : error
2022-04-27 19:51:51 +00:00
2023-08-22 14:46:03 +00:00
frontend-test-ce :
2022-04-27 19:51:51 +00:00
runs-on : ubuntu-latest
2023-08-22 14:46:03 +00:00
needs : [ frontend-build-ce]
2022-04-27 19:51:51 +00:00
strategy :
matrix :
2022-05-09 18:57:54 +00:00
partition : [ 1 , 2 , 3 , 4 ]
2022-04-27 19:51:51 +00:00
env :
CONSUL_NSPACES_ENABLED : 0
2023-08-22 14:46:03 +00:00
EMBER_TEST_REPORT : test-results/report-ce.xml #outputs test report for CI test summary
2022-04-27 19:51:51 +00:00
EMBER_TEST_PARALLEL : true #enables test parallelization with ember-exam
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
2023-08-22 14:46:03 +00:00
- name : Download CE Frontend
2024-05-14 19:49:03 +00:00
uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
2022-04-27 19:51:51 +00:00
with :
2023-08-22 14:46:03 +00:00
name : frontend-ce-${{ env.BRANCH_NAME }}
2022-05-09 18:57:54 +00:00
path : ./ui/packages/consul-ui/dist
2022-04-27 19:51:51 +00:00
2023-08-22 14:46:03 +00:00
- name : Ember Test CE
2022-04-27 19:51:51 +00:00
id : cache
working-directory : ./ui/packages/consul-ui
run : node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
frontend-build-ent :
runs-on : ubuntu-latest
env :
JOBS : 2
CONSUL_NSPACES_ENABLED : 1
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
- name : Ember Build ENT
2023-08-22 14:46:03 +00:00
id : build-ce
2022-04-27 19:51:51 +00:00
working-directory : ./ui/packages/consul-ui
run : make build-ci
- name : Upload ENT Frontend
2024-05-14 19:49:03 +00:00
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
name : frontend-ent-${{ env.BRANCH_NAME }}
path : ./ui/packages/consul-ui/dist
if-no-files-found : error
2022-04-27 19:51:51 +00:00
frontend-test-ent :
runs-on : ubuntu-latest
needs : [ frontend-build-ent]
strategy :
matrix :
2022-05-09 18:57:54 +00:00
partition : [ 1 , 2 , 3 , 4 ]
2022-04-27 19:51:51 +00:00
env :
CONSUL_NSPACES_ENABLED : 1
2023-08-22 14:46:03 +00:00
EMBER_TEST_REPORT : test-results/report-ce.xml #outputs test report for CI test summary
2022-04-27 19:51:51 +00:00
EMBER_TEST_PARALLEL : true #enables test parallelization with ember-exam
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
- name : Download ENT Frontend
2024-05-14 19:49:03 +00:00
uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
name : frontend-ent-${{ env.BRANCH_NAME }}
path : ./ui/packages/consul-ui/dist
2022-04-27 19:51:51 +00:00
- name : Ember Test ENT
id : cache
working-directory : ./ui/packages/consul-ui
run : node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
frontend-test-coverage-ent :
runs-on : ubuntu-latest
needs : [ frontend-build-ent]
steps :
2024-05-14 19:49:03 +00:00
- uses : actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
ref : ${{ env.BRANCH }}
2022-04-27 19:51:51 +00:00
# Not necessary to use yarn, but enables caching
2024-05-14 19:49:03 +00:00
- uses : actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
2022-04-27 19:51:51 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : 18
2022-04-27 19:51:51 +00:00
cache : 'yarn'
cache-dependency-path : ./ui/yarn.lock
- name : Install
id : install
working-directory : ./ui
run : make deps
2022-05-09 18:57:54 +00:00
- name : Download ENT Frontend
2024-05-14 19:49:03 +00:00
uses : actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
2022-05-09 18:57:54 +00:00
with :
name : frontend-ent-${{ env.BRANCH_NAME }}
path : ./ui/packages/consul-ui/dist
2022-04-27 19:51:51 +00:00
- name : Run ENT Code Coverage
working-directory : ./ui/packages/consul-ui
run : make test-coverage-ci
slack-failure-notification :
runs-on : ubuntu-latest
2023-08-22 14:46:03 +00:00
needs : [ frontend-test-ce, frontend-test-ent]
2022-04-27 19:51:51 +00:00
if : ${{ failure() }}
steps :
- name : Slack Notification
id : slack
2024-05-14 19:49:03 +00:00
uses : slackapi/slack-github-action@70cd7be8e40a46e8b0eced40b0de447bdb42f68e # v1.26.0
2022-04-27 19:51:51 +00:00
with :
2022-05-09 18:57:54 +00:00
payload : |
{
"message": "One or more nightly UI tests have failed on branch ${{ env.BRANCH }} for Consul. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
2022-04-27 19:51:51 +00:00
env :
2022-05-09 18:57:54 +00:00
SLACK_WEBHOOK_URL : ${{ secrets.CONSUL_UI_SLACK_WEBHOOK }}