forked from yagobski/loopback-connector-elastic-search
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rifa Achrinza <[email protected]>
- Loading branch information
Showing
2 changed files
with
121 additions
and
0 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,119 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: '0 2 * * 1' # At 02:00 on Monday | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
node-version: [10, 12, 14, 16, 17, 18] | ||
db-image: | ||
- elasticsearch:7.17.3 | ||
- elasticsearch:8.2.0 | ||
- opensearchproject/opensearch:1.3.2 | ||
fail-fast: false | ||
services: | ||
db: | ||
image: ${{ matrix.db-image }} | ||
ports: ["9200:9200"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: | ||
uses: supercharge/[email protected] | ||
with: | ||
mongodb-version: ${{ matrix.mongodb-version }} | ||
- name: Bootstrap project | ||
run: npm ci --ignore-scripts | ||
- name: Run tests | ||
run: npm test | ||
- name: Publish coverage report to Coveralls | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
flag-name: run-es@${{ matrix.db-version }}-node@${{ matrix.node-version }} | ||
parallel: true | ||
|
||
posttest: | ||
name: Post-Test | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Coveralls finished | ||
uses: coverallsapp/github-action@master | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
parallel-finished: true | ||
|
||
code-lint: | ||
name: Code Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Bootstrap project | ||
run: npm ci --ignore-scripts | ||
- name: Verify code linting | ||
run: npm run lint | ||
|
||
commit-lint: | ||
name: Commit Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Bootstrap project | ||
run: npm ci --ignore-scripts | ||
- name: Verify commit linting | ||
run: | | ||
npm exec \ | ||
--no-install \ | ||
--package=@commitlint/cli \ | ||
-- \ | ||
commitlint \ | ||
--verbose \ | ||
--from=origin/master \ | ||
--to=HEAD | ||
codeql: | ||
name: CodeQL | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage | ||
security-events: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: 'javascript' | ||
config-file: ./.github/codeql/codeql-config.yml | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
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,2 @@ | ||
package-lock=true | ||
scripts-prepend-node-path=true |