Skip to content

Fixed double padding in recurring actions #2672

Fixed double padding in recurring actions

Fixed double padding in recurring actions #2672

name: Javascript unit tests
on:
push:
branches:
- master
paths:
- 'web/html/src/**'
- '.github/workflows/javascript-unit-tests.yml'
pull_request:
paths:
- 'web/html/src/**'
- '.github/workflows/javascript-unit-tests.yml'
jobs:
javascript_unit_tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# See: https://github.com/actions/cache/blob/main/examples.md#node---yarn
- name: Get Yarn cache directory
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
# FYI, caching node_modules directly instead of Yarn's cache offers no considerable speed benefit and increases the cache size
- name: Use Yarn cache
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
# This step is required even on a cache hit or the cache won't hydrate node_modules.
# `--prefer-offline` means we prefer the cache over fetching things from the network.
# See: https://stackoverflow.com/a/62244232/1470607
- name: Install dependencies
run: yarn --cwd web/html/src install --frozen-lockfile --prefer-offline
- name: Run tests
run: yarn --cwd web/html/src test --no-cache
env:
BABEL_ENV: 'test'