Skip to content

Commit

Permalink
break nodejs action and update badge (#165)
Browse files Browse the repository at this point in the history
Issue Resolved:
#164

Signed-off-by: Anan Zhuang <[email protected]>
  • Loading branch information
ananzh authored Aug 27, 2021
1 parent 5c2f60c commit d494903
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 175 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Bundler

on: [push, pull_request]

jobs:
bundler-support:
name: Bundler support
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install
run: |
npm install
npm install --prefix test/bundlers/parcel-test
npm install --prefix test/bundlers/rollup-test
npm install --prefix test/bundlers/webpack-test
- name: Build
run: |
npm run build --prefix test/bundlers/parcel-test
npm run build --prefix test/bundlers/rollup-test
npm run build --prefix test/bundlers/webpack-test
- name: Run bundle
run: |
npm start --prefix test/bundlers/parcel-test
npm start --prefix test/bundlers/rollup-test
npm start --prefix test/bundlers/webpack-test
36 changes: 36 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Coverage

on: [push, pull_request]

jobs:
code-coverage:
name: Code coverage
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2

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

- name: Install
run: |
npm install
- name: Code coverage report
run: |
npm run test:coverage-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
files: ./coverage.lcov
fail_ci_if_error: true

- name: Code coverage 90%
run: |
npm run test:coverage-90
77 changes: 77 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Integration

on: [push, pull_request]

jobs:
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install
- name: Integration test
run: |
npm run test:integration:helpers
helpers-secure-integration-test:
name: Helpers integration test with secure cluster
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} secure cluster
run: |
export SECURE_INTEGRATION=true
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install
- name: Integration test with secure cluster
run: |
npm run test:integration:helpers-secure
28 changes: 28 additions & 0 deletions .github/workflows/license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: License

on: [push, pull_request]

jobs:
license:
name: License check
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2

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

- name: Install
run: |
npm install
- name: License checker
run: |
npm run license-checker
175 changes: 0 additions & 175 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,178 +39,3 @@ jobs:
- name: Type Definitions
run: |
npm run test:types
helpers-integration-test:
name: Helpers integration test
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install
- name: Integration test
run: |
npm run test:integration:helpers
helpers-secure-integration-test:
name: Helpers integration test with secure cluster
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} secure cluster
run: |
export SECURE_INTEGRATION=true
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install
run: |
npm install
- name: Integration test with secure cluster
run: |
npm run test:integration:helpers-secure
bundler-support:
name: Bundler support
runs-on: ubuntu-latest

strategy:
matrix:
cluster: ["opendistro", "opensearch"]

steps:
- uses: actions/checkout@v2

- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs ${{ matrix.cluster }} cluster
run: |
make cluster.clean cluster.${{ matrix.cluster }}.build cluster.${{ matrix.cluster }}.start
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install
run: |
npm install
npm install --prefix test/bundlers/parcel-test
npm install --prefix test/bundlers/rollup-test
npm install --prefix test/bundlers/webpack-test
- name: Build
run: |
npm run build --prefix test/bundlers/parcel-test
npm run build --prefix test/bundlers/rollup-test
npm run build --prefix test/bundlers/webpack-test
- name: Run bundle
run: |
npm start --prefix test/bundlers/parcel-test
npm start --prefix test/bundlers/rollup-test
npm start --prefix test/bundlers/webpack-test
code-coverage:
name: Code coverage
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2

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

- name: Install
run: |
npm install
- name: Code coverage report
run: |
npm run test:coverage-report
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.lcov
fail_ci_if_error: false

- name: Code coverage 90%
run: |
npm run test:coverage-90
license:
name: License check
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- uses: actions/checkout@v2

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

- name: Install
run: |
npm install
- name: License checker
run: |
npm run license-checker
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
[![Nodejs](https://github.com/opensearch-project/opensearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/opensearch-project/opensearch-js/actions/workflows/nodejs.yml)
[![Integration](https://github.com/opensearch-project/opensearch-js/actions/workflows/integration.yml/badge.svg)](https://github.com/opensearch-project/opensearch-js/actions/workflows/integration.yml)
[![Bundler](https://github.com/opensearch-project/opensearch-js/actions/workflows/bundler.yml/badge.svg)](https://github.com/opensearch-project/opensearch-js/actions/workflows/bundler.yml)
[![codecov](https://codecov.io/gh/opensearch-project/opensearch-js/branch/main/graph/badge.svg?token=1qbAgj1DnX)](https://codecov.io/gh/opensearch-project/opensearch-js)
[![Chat](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/clients/)
![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success)

![OpenSearch logo](OpenSearch.svg)

OpenSearch Node.js client
Expand Down

0 comments on commit d494903

Please sign in to comment.