Nightly Test Main #404
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) HashiCorp, Inc. | |
# SPDX-License-Identifier: MPL-2.0 | |
name: Nightly Test Main | |
on: | |
schedule: | |
- cron: '0 4 * * *' | |
workflow_dispatch: {} | |
env: | |
EMBER_PARTITION_TOTAL: 4 # Has to be changed in tandem with the matrix.partition | |
BRANCH: "main" | |
BRANCH_NAME: "main" # Used for naming artifacts | |
jobs: | |
frontend-test-workspace-node: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
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 | |
frontend-build-oss: | |
runs-on: ubuntu-latest | |
env: | |
JOBS: 2 | |
CONSUL_NSPACES_ENABLED: 0 | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
cache: 'yarn' | |
cache-dependency-path: ./ui/yarn.lock | |
- name: Install | |
id: install | |
working-directory: ./ui | |
run: make deps | |
- name: Ember Build OSS | |
id: build-oss | |
working-directory: ./ui/packages/consul-ui | |
run: make build-ci | |
- name: Upload OSS Frontend | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: frontend-oss-${{ env.BRANCH_NAME }} | |
path: ./ui/packages/consul-ui/dist | |
if-no-files-found: error | |
frontend-test-oss: | |
runs-on: ubuntu-latest | |
needs: [frontend-build-oss] | |
strategy: | |
matrix: | |
partition: [ 1, 2, 3, 4 ] | |
env: | |
CONSUL_NSPACES_ENABLED: 0 | |
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary | |
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
cache: 'yarn' | |
cache-dependency-path: ./ui/yarn.lock | |
- name: Install | |
id: install | |
working-directory: ./ui | |
run: make deps | |
- name: Download OSS Frontend | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: frontend-oss-${{ env.BRANCH_NAME }} | |
path: ./ui/packages/consul-ui/dist | |
- name: Ember Test OSS | |
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: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
cache: 'yarn' | |
cache-dependency-path: ./ui/yarn.lock | |
- name: Install | |
id: install | |
working-directory: ./ui | |
run: make deps | |
- name: Ember Build ENT | |
id: build-oss | |
working-directory: ./ui/packages/consul-ui | |
run: make build-ci | |
- name: Upload ENT Frontend | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
with: | |
name: frontend-ent-${{ env.BRANCH_NAME }} | |
path: ./ui/packages/consul-ui/dist | |
if-no-files-found: error | |
frontend-test-ent: | |
runs-on: ubuntu-latest | |
needs: [frontend-build-ent] | |
strategy: | |
matrix: | |
partition: [ 1, 2, 3, 4 ] | |
env: | |
CONSUL_NSPACES_ENABLED: 1 | |
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary | |
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
cache: 'yarn' | |
cache-dependency-path: ./ui/yarn.lock | |
- name: Install | |
id: install | |
working-directory: ./ui | |
run: make deps | |
- name: Download ENT Frontend | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: frontend-ent-${{ env.BRANCH_NAME }} | |
path: ./ui/packages/consul-ui/dist | |
- 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: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
ref: ${{ env.BRANCH }} | |
# Not necessary to use yarn, but enables caching | |
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version: 14 | |
cache: 'yarn' | |
cache-dependency-path: ./ui/yarn.lock | |
- name: Install | |
id: install | |
working-directory: ./ui | |
run: make deps | |
- name: Download ENT Frontend | |
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 | |
with: | |
name: frontend-ent-${{ env.BRANCH_NAME }} | |
path: ./ui/packages/consul-ui/dist | |
- name: Run ENT Code Coverage | |
working-directory: ./ui/packages/consul-ui | |
run: make test-coverage-ci | |
slack-failure-notification: | |
runs-on: ubuntu-latest | |
needs: [frontend-test-oss, frontend-test-ent] | |
if: ${{ failure() }} | |
steps: | |
- name: Slack Notification | |
id: slack | |
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 # v1.24.0 | |
with: | |
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 }}" | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.CONSUL_UI_SLACK_WEBHOOK }} |