Repository navigation
ci: migrate to shared workflows #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,33 @@ | ||
| # SPDX-FileCopyrightText: 2020-2025 CERN. | ||
| # SPDX-FileCopyrightText: 2026 CESNET. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| 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: [24.x, 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"]' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,9 +110,6 @@ | |
| "search", | ||
| "react search" | ||
| ], | ||
| "eslintConfig": { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason why we are deleting this ESLint config?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because .eslintrc.yml already imports react-app https://github.com/inveniosoftware/eslint-config-invenio/blob/master/configs/main.yaml
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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%", | ||
|
|
@@ -127,7 +124,7 @@ | |
| ] | ||
| }, | ||
| "engines": { | ||
| "node": ">=14.0.0" | ||
| "node": ">=22.0.0" | ||
| }, | ||
| "jest": { | ||
| "moduleNameMapper": { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-FileCopyrightText: 2026 CERN. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # 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 --max-warnings=0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/usr/bin/env bash | ||
| # SPDX-FileCopyrightText: 2026 CERN. | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| # 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 |
There was a problem hiding this comment.
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?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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?