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
51 changes: 21 additions & 30 deletions .github/workflows/js-tests.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,38 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020-2024 CERN.
# Copyright (C) 2020 Northwestern University.
# Copyright (C) 2024 Graz University of Technology.
#
# React-SearchKit is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.

name: CI

on:
push:
branches:
- master
- "feature/*"
- "maint-**"
pull_request:
branches:
- master
- "maint-**"
- "feature/*"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 2 * * 5'
- cron: "0 2 * * 5"
workflow_dispatch:
inputs:
reason:
description: 'Reason'
description: "Reason"
required: false
default: 'Manual trigger'
default: "Manual trigger"

jobs:
Tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [22.x, 18.x, 16.x]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install & Build
run: npm ci

- name: Lint
run: npm run lint

- name: Test
run: npm test

- name: Coverage
run: npm test -- --coverage
JS:
uses: inveniosoftware/workflows/.github/workflows/tests-js.yml@master
with:
js-working-directory: ./
node-version: '["22.x", "24.x", "26.x"]'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we test with 3 nodejs versions? for python we use an upper and lower bound?

Copy link
Copy Markdown

@OliverGeneser OliverGeneser May 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think it makes sense to test every LTS version starting from our lower bound 22.x 🤔 Do you know the reason why it was chosen to only test upper and lower bound in the python modules?

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
"search",
"react search"
],
"eslintConfig": {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we are deleting this ESLint config?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it was kinda redundant with .eslintrc.yml already present here: https://github.com/oarepo/react-searchkit/blob/014bc1124937f840acfa43120677e0fabaf82eda/.eslintrc.yml

"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -111,6 +108,6 @@
]
},
"engines": {
"node": ">=14.0.0"
"node": ">=22.0.0"
}
}
32 changes: 32 additions & 0 deletions run-js-linter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# React-SearchKit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

# Usage:
# ./run-js-linter.sh [args]

# Arguments
# -i|--install: installs dependencies
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color

for arg in $@; do
case ${arg} in
-i|--install)
npm ci;;
-f|--fix)
printf "${GREEN}Run eslint${NC}\n";
npx eslint -c .eslintrc.yml src/ --ext .js --fix;;
*)
printf "Argument ${RED}$arg${NC} not supported\n"
exit 1;;
esac
done

printf "${GREEN}Run eslint${NC}\n"
npx eslint -c .eslintrc.yml src/ --ext .js
29 changes: 29 additions & 0 deletions run-js-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# -*- coding: utf-8 -*-
#
# Copyright (C) 2026 CERN.
#
# React-SearchKit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

# Usage:
# ./run-js-tests.sh [args]

# Arguments
# -i|--install: installs dependencies
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color

for arg in $@; do
case ${arg} in
-i|--install)
npm ci;;
*)
printf "Argument ${RED}$arg${NC} not supported\n"
exit 1;;
esac
done

printf "${GREEN}Run tests${NC}\n"
CI=true npm test