ci: add nightly action for UI testing release branches

This commit is contained in:
DanStough 2022-04-27 15:51:51 -04:00 committed by Dan Stough
parent fa6e17bdfd
commit 5f6257327c
1 changed files with 269 additions and 0 deletions

View File

@ -0,0 +1,269 @@
name: nightly-release-ui-test
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch: {}
env:
BRANCH_MATRIX: "[ release/1.10.x, release/1.11.x, release/1.12.x ]"
EMBER_PARTITION_TOTAL: 4
EMBER_PARTITION_MATRIX: "[ 1, 2, 3, 4 ]"
jobs:
frontend-cache:
runs-on: ubuntu-latest
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: ./ui/yarn.lock
- name: Install
id: install
working-directory: ./ui
run: make deps
frontend-test-workspace-node:
runs-on: ubuntu-latest
needs: [frontend-cache]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
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
needs: [frontend-cache]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
env:
JOBS: 2
CONSUL_NSPACES_ENABLED: 0
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
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@v3
with:
name: frontend-oss-${{ matrix.branch }}
path: .ui/packages/consul-ui/dist
frontend-test-oss:
runs-on: ubuntu-latest
needs: [frontend-build-oss]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
partion: ${{ env.EMBER_PARTITION_MATRIX }}
env:
CONSUL_NSPACES_ENABLED: 0
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CircleCI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
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/upload-artifact@v3
with:
name: frontend-oss-${{ matrix.branch }}
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
# TODO: add test-reporter: https://github.com/marketplace/actions/test-reporter
frontend-build-ent:
runs-on: ubuntu-latest
needs: [frontend-cache]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
env:
JOBS: 2
CONSUL_NSPACES_ENABLED: 1
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
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@v3
with:
name: frontend-ent-${{ matrix.branch }}
path: .ui/packages/consul-ui/dist
frontend-test-ent:
runs-on: ubuntu-latest
needs: [frontend-build-ent]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
partion: ${{ env.EMBER_PARTITION_MATRIX }}
env:
CONSUL_NSPACES_ENABLED: 1
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CircleCI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
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/upload-artifact@v3
with:
name: frontend-ent-${{ matrix.branch }}
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
# TODO: add test-reporter: https://github.com/marketplace/actions/test-reporter
frontend-test-coverage-ent:
runs-on: ubuntu-latest
needs: [frontend-build-ent]
strategy:
matrix:
branch: ${{ env.BRANCH_MATRIX }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ matrix.branch }}
# Not necessary to use yarn, but enables caching
- uses: actions/setup-node@v3
with:
node-version: 14
cache: 'yarn'
cache-dependency-path: ./ui/yarn.lock
- name: Install
id: install
working-directory: ./ui
run: make deps
- 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@main
with:
payload: "{\"message\":\"One or more nightly UI test have failed on a release branch for Consul. [Link to Failed Action](${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}). \"}"
env:
SLACK_WEBHOOK_URL: ${{ secrets.CONSUL_CORE_SLACK_WEBHOOK }}