fix: Widget panel fixes #3666
Workflow file for this run
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
# This workflow will perform unit tests of the web application and update code coverage reports | |
name: Unit Tests | |
on: | |
push: | |
branches: | |
- main | |
- 'release/**' | |
- 'feature/**' | |
pull_request: | |
branches: | |
- main | |
- 'release/**' | |
- 'feature/**' | |
jobs: | |
unit: | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' # This action defaults to only getting the latest commit. Setting to 0 makes it retrieve the full git commit history | |
- name: Fetch base branch (PR) | |
if: ${{ github.event_name == 'pull_request' }} | |
run: git fetch --no-tags origin ${{ github.event.pull_request.base.ref }} | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Cache jest | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.jest-cache | |
packages/*/.jest-cache | |
key: ${{ runner.os }}-jestcache-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-jestcache- | |
- name: Cache linters | |
uses: actions/cache@v4 | |
with: | |
path: | | |
.eslintcache | |
packages/*/.eslintcache | |
.stylelintcache | |
packages/*/.stylelintcache | |
key: ${{ runner.os }}-lintcache-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-lintcache- | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
node_modules | |
packages/*/node_modules | |
key: unit-node-modules-${{ hashFiles('package-lock.json')}} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci --no-audit | |
# Run unit tests on all files for accurate code coverage | |
# Lint only changed files so linting is faster | |
# Caching with the absolute path b/c Jest will make a folder in each project | |
# Then there's caches in all package folders | |
- name: Unit Test (Pull Request) | |
if: ${{ github.event_name == 'pull_request' }} | |
run: | | |
npm run test:unit -- --cacheDirectory $PWD/.jest-cache | |
npm run test:lint -- --changedSince origin/${{ github.event.pull_request.base.ref }} --cacheDirectory $PWD/.jest-cache | |
npm run test:golden-layout | |
- name: Unit Test (Push) | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
npm run test:unit -- --cacheDirectory $PWD/.jest-cache | |
npm run test:lint -- --lastCommit --cacheDirectory $PWD/.jest-cache | |
npm run test:golden-layout | |
- name: Codecov report | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage | |
flags: unit |