Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,34 @@ jobs:
- name: Run linter
run: npm run lint

lintcss:
name: CSS linting
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3

- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: 24.15.0
registry-url: https://registry.npmjs.org/

- name: Restore node_modules
id: node-modules-cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: node_modules
key: node-modules-${{ runner.os }}-node24.15.0-${{ hashFiles('package-lock.json', 'patches/**') }}

- name: Install NPM dependencies (cache miss fallback)
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit --no-fund

- name: Run CSS linter
run: npm run lint:css

test:
name: Unit tests and e2e tests
needs: setup
Expand Down
1 change: 1 addition & 0 deletions .husky/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"skipPreCommit": false,
"allowDirtyCommit": true,
"lintOnCommit": false,
"lintCssOnCommit": false,
"typecheckOnCommit": false,
"testOnCommit": false,

Expand Down
13 changes: 13 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ then
fi
fi

if [ "$POLAR_LINT_CSS_ON_COMMIT" = "yes" ]
then
if ! npm run lint:css
then
echo "Cannot commit: CSS linting failed." >&2
echo "Please fix the above error(s)." >&2
echo >&2
echo "If you want to commit anyway, set POLAR_LINT_CSS_ON_COMMIT=no" >&2
echo "If you want to skip all pre-commit checks, set POLAR_SKIP_PRE_COMMIT=yes" >&2
exit 1
fi
fi

if [ "$POLAR_TYPECHECK_ON_COMMIT" = "yes" ]
then
if ! npm run tsc
Expand Down
Loading
Loading