forked from opensearch-project/dashboards-observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BACKPORT] Backport linter CI to 2.x (opensearch-project#1313)
* linter CI (opensearch-project#1301) Signed-off-by: Eric <[email protected]> * change version to 2.x Signed-off-by: Eric <[email protected]> * add missing scripts Signed-off-by: Eric <[email protected]> --------- Signed-off-by: Eric <[email protected]> (cherry picked from commit 138bd21)
- Loading branch information
1 parent
c3adaad
commit 9ece072
Showing
5 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
/data | ||
/build | ||
/target | ||
/.eslintrc.js | ||
/cypress.config.js | ||
!.cypress/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: Lint | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PLUGIN_NAME: dashboards-observability | ||
OPENSEARCH_DASHBOARDS_VERSION: '2.x' | ||
|
||
jobs: | ||
build: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout OpenSearch Dashboards | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: opensearch-project/Opensearch-Dashboards | ||
ref: ${{ env.OPENSEARCH_DASHBOARDS_VERSION }} | ||
path: OpenSearch-Dashboards | ||
|
||
- name: Checkout dashboards observability | ||
uses: actions/checkout@v2 | ||
with: | ||
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} | ||
|
||
- name: Get node and yarn versions | ||
working-directory: ${{ env.WORKING_DIR }} | ||
id: versions_step | ||
run: | | ||
echo "::set-output name=node_version::$(cat ./OpenSearch-Dashboards/.nvmrc | cut -d"." -f1)" | ||
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")" | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ steps.versions_step.outputs.node_version }} | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Install correct yarn version for OpenSearch Dashboards | ||
run: | | ||
npm uninstall -g yarn | ||
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}" | ||
npm i -g yarn@${{ steps.versions_step.outputs.yarn_version }} | ||
- name: Bootstrap the plugin | ||
working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} | ||
run: | ||
yarn osd bootstrap | ||
|
||
- name: lint code base | ||
working-directory: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} | ||
run: | | ||
git fetch origin 2.x | ||
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB origin/2.x | grep -E "\.(js|ts|tsx)$") | ||
if [ -n "$CHANGED_FILES" ]; then | ||
echo "Linting changed files..." | ||
yarn lint $CHANGED_FILES | ||
else | ||
echo "No JavaScript/TypeScript files changed." | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"last_github_commit": "566981fa87cb921b82e125eb01e22d88f249a21c", | ||
"last_gitfarm_commit": "ac9b505f5c9043e3ca0a3a9c64ff9c5f14b0d6b4" | ||
"last_github_commit": "138bd21476206b64d1acdc3894fde9e39095e8f7", | ||
"last_gitfarm_commit": "dd30f823de7c04b7dbd47b954e45234a7cccdbda" | ||
} |
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