Update package.json #43
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
name: Unit tests | |
on: | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: {} | |
permissions: | |
contents: read | |
jobs: | |
test-unit: | |
name: unit tests on ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
- name: Get npm cache directory | |
shell: bash | |
run: echo "npm_cache_dir=$(npm config get cache)" >> ${GITHUB_ENV} | |
- name: Use cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.npm_cache_dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Python setuptools (macOS) | |
if: runner.os == 'macOS' | |
run: brew install python-setuptools | |
- name: Install dependencies | |
uses: nick-fields/retry@v3 | |
with: | |
timeout_minutes: 20 | |
max_attempts: 3 | |
retry_on: error | |
command: npm ci | |
- name: Run test units | |
run: npm run test:unit | |
- name: Clean after tests | |
run: npm run clean | |
- name: Check untracked files | |
shell: bash | |
run: for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $f; done |