feat: Theming Iris Grid #1557
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/**' | |
pull_request: | |
branches: | |
- main | |
- 'release/**' | |
jobs: | |
unit: | |
runs-on: ubuntu-22.04 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- uses: actions/checkout@v3 | |
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@v3 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Cache jest | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.jest-cache | |
packages/*/.jest-cache | |
key: ${{ runner.os }}-jestcache-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-jestcache- | |
- name: Cache linters | |
uses: actions/cache@v3 | |
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@v3 | |
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@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage | |
flags: unit |