Skip to content

AG-11990 - Fix Financial Charts volume + price series hover conflicts. #8722

AG-11990 - Fix Financial Charts volume + price series hover conflicts.

AG-11990 - Fix Financial Charts volume + price series hover conflicts. #8722

Workflow file for this run

name: CI
on:
push:
branches:
- 'latest'
- 'b[0-9][0-9]?.[0-9][0-9]?.[0-9][0-9]?'
pull_request:
branches:
- 'latest'
- 'b[0-9][0-9]?.[0-9][0-9]?.[0-9][0-9]?'
workflow_dispatch:
inputs:
clean_checkout:
description: 'Disable all caching'
type: 'choice'
required: true
default: 'false'
options:
- 'true'
- 'false'
nx_command:
type: 'choice'
required: true
default: 'affected'
options:
- 'affected'
- 'run-many'
env:
NX_REJECT_UNKNOWN_LOCAL_CACHE: 0
NX_NO_CLOUD: true
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_BRANCH: ${{ github.ref }}
# Set to --batch to enable batch execution.
NX_BATCH_FLAG: '--batch'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/latest' }}
jobs:
execute_blt:
runs-on: ubuntu-24.04
outputs:
nx_base: ${{ steps.setup.outputs.base }}
build: ${{ steps.build.outcome || '' }}
lint: ${{ steps.lint.outcome || '' }}
format: ${{ steps.format.outcome || '' }}
test_count: ${{ steps.test_count.outputs.test_count }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Refs
run: git fetch origin latest-success latest
- name: Setup
id: setup
uses: ./.github/actions/setup-nx
with:
clean: ${{ github.event.inputs.clean_checkout }}
- name: nx format:check
id: format
if: steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped'
run: |
if [[ "${{ github.event.inputs.nx_command || 'affected' }}" == "run-many" ]] ; then
yarn nx format:check --all
else
yarn nx format:check --base ${{ steps.setup.outputs.base }}
fi
- name: nx lint
id: lint
if: steps.setup.outputs.type != 'pr' && (steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped')
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t lint --parallel=3 --exclude all
- name: nx lint (diff)
id: lint_diff
if: steps.setup.outputs.type == 'pr' && (steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped')
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t lint --parallel=3 --exclude all
env:
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
- name: nx build
id: build
if: steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped'
run: |
# Non-batched builds - some TS/JS targets will fail if run with --batch, so build them unbatched first.
yarn nx run-many -p tag:no-batching -t build --parallel=3
# Batched builds.
yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t build --parallel=3 --exclude all ${NX_BATCH_FLAG}
- name: nx run generate-gallery-thumbnail
if: steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped'
run: yarn nx run generate-gallery-thumbnail --example simple-bar
- name: nx run-many -t validate-examples
if: steps.setup.outcome == 'success' || steps.setup.outcome == 'skipped'
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t validate-examples --parallel=3 --exclude all
- name: Count test targets to run
id: test_count
run: |
if [[ "${{ github.event.inputs.nx_command || 'affected' }}" == "run-many" ]] ; then
echo "test_count=1000" >> $GITHUB_OUTPUT
else
echo "test_count=$(yarn -s nx show projects --affected --base ${{ steps.setup.outputs.base }} -t test | wc -l)" >> $GITHUB_OUTPUT
fi
test:
runs-on: ubuntu-24.04
needs: execute_blt
if: needs.execute_blt.outputs.test_count > 0
strategy:
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7, 8]
name: test (${{ matrix.shard }}/${{ strategy.job-total }})
env:
NX_PARALLEL: 1
NX_BASE: ${{ needs.execute_blt.outputs.nx_base }}
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
id: setup
uses: ./.github/actions/setup-nx
- name: nx test
if: matrix.shard != 0
id: test
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t test --configuration=ci --exclude tag:no-sharding --exclude all --shard=${{ matrix.shard }}/$((${{ strategy.job-total }} - 1))
- name: nx test (non-sharded)
if: matrix.shard == 0
id: test-no-shard
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t test --configuration=ci --exclude '*,!tag:no-sharding'
- name: nx benchmark
if: matrix.shard == 0
id: benchmark
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t benchmark --configuration=ci --exclude all
- name: nx pack:verify
if: matrix.shard == 0
id: pack-verify
run: yarn nx ${{ github.event.inputs.nx_command || 'affected' }} -t pack:verify
- name: Perist test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{matrix.shard}}
path: |
reports/
packages/**/__diff_output__/*
report:
runs-on: ubuntu-24.04
needs: [execute_blt, test, sonarqube]
if: cancelled() != true
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch Refs
run: git fetch origin latest-success latest
- uses: actions/download-artifact@v3
with:
path: test-results/
- name: Merge JUnit Report XMLs
run: |
yarn global add junit-report-merger
reports=$(find test-results/ -name \*.xml -type f -exec basename \{\} \; | sort | uniq)
mkdir -p reports/
echo "$reports" | (while read name ; do
yarn exec -s jrm reports/${name} "test-results/**/${name}"
done)
- name: Test Report
uses: dorny/test-reporter@v1
if: needs.test.result == 'success' || needs.test.result == 'failure'
id: testReport
continue-on-error: true
with:
name: 'Tests Results'
path: reports/*.xml
reporter: jest-junit
- name: Check last job status
id: lastJobStatus
if: always() && github.ref == 'refs/heads/latest'
run: |
WORKFLOW_STATUS="success"
if [[ "${{ needs.execute_blt.result }}" == "failure" ]] ; then
WORKFLOW_STATUS="failure"
elif [ "${{ needs.test.result }}" == "failure" ] ; then
WORKFLOW_STATUS="failure"
elif [ "${{ needs.sonarqube.result }}" == "failure" ] ; then
WORKFLOW_STATUS="failure"
fi
echo "workflowStatus=${WORKFLOW_STATUS}" >> $GITHUB_OUTPUT
LAST_WORKFLOW_STATUS=$(gh run list --workflow .github/workflows/ci.yml -b latest | grep -oh "completed.*" | grep -v "cancelled" | head -1 | awk '{print $2}')
if [ "$GITHUB_RUN_ATTEMPT" -ge 2 ]; then
# Handle re-run cases - there is no way to query the previous run status, so we assume the most
# common scenario will be re-run after failure.
LAST_WORKFLOW_STATUS="failure"
fi
if [ "$LAST_WORKFLOW_STATUS" != "$WORKFLOW_STATUS" ]; then
echo "status changed from $LAST_WORKFLOW_STATUS to $WORKFLOW_STATUS"
echo "changedState=true" >> $GITHUB_OUTPUT
else
echo "status is still $WORKFLOW_STATUS"
echo "changedState=false" >> $GITHUB_OUTPUT
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit History
id: commits
if: always() && job.status != 'cancelled' && github.ref == 'refs/heads/latest' && steps.lastJobStatus.outputs.changedState == 'true'
run: |
GIT_LOG=$(git log HEAD ^${{ needs.execute_blt.outputs.nx_base }} --format="%an (%h) %s")
echo "GIT_LOG<<EOF" >> $GITHUB_ENV
echo "$GIT_LOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Tag Latest Successful Commit
if: success() && github.ref == 'refs/heads/latest' && steps.lastJobStatus.outputs.workflowStatus == 'success'
uses: EndBug/latest-tag@latest
with:
ref: latest-success
description: Latest commit to pass GitHub Actions workflow on latest branch.
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
if: always() && job.status != 'cancelled' && github.ref == 'refs/heads/latest' && steps.lastJobStatus.outputs.changedState == 'true'
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_COLOR: ${{ steps.lastJobStatus.outputs.workflowStatus }}
SLACK_ICON: https://avatars.slack-edge.com/2020-11-25/1527503386626_319578f21381f9641cd8_192.png
SLACK_USERNAME: ag-charts CI
SLACK_FOOTER: ''
SLACK_MESSAGE: >
Build: ${{ needs.execute_blt.outputs.build == 'success' && '✅' || needs.execute_blt.outputs.build == 'failure' && '❌' || 'NA' }}
Lint: ${{ needs.execute_blt.outputs.lint == 'success' && '✅' || needs.execute_blt.outputs.lint == 'failure' && '❌' || 'NA' }}
Format: ${{ needs.execute_blt.outputs.format == 'success' && '✅' || needs.execute_blt.outputs.format == 'failure' && '❌' || 'NA' }}
Test: ${{ needs.test.result == 'success' && '✅' || needs.test.result == 'failure' && '❌' || 'NA' }}
SonarQube: ${{ needs.sonarqube.result == 'success' && '✅' || needs.sonarqube.result == 'failure' && '❌' || 'NA' }}
*Changes:*
${{ env.GIT_LOG }}
- name: Kick-off E2E tests
if: needs.test.result == 'success'
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run e2e.yml --ref ${{github.head_ref || github.ref}}
sonarqube:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
with:
args: >
-Dsonar.qualitygate.wait=true
env:
SONAR_TOKEN: ${{ secrets.SONAR_LOGIN }}
SONAR_HOST_URL: https://sonarcloud.io