-
Notifications
You must be signed in to change notification settings - Fork 45
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
base: master
Are you sure you want to change the base?
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,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"]' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,9 +94,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? 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
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%", | ||
|
|
@@ -111,6 +108,6 @@ | |
| ] | ||
| }, | ||
| "engines": { | ||
| "node": ">=14.0.0" | ||
| "node": ">=22.0.0" | ||
| } | ||
| } | ||
| 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 |
| 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 |
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?