Skip to content

Commit e8f8958

Browse files
committed
ci: update environment
Signed-off-by: Rifa Achrinza <25147899+achrinza@users.noreply.github.com>
1 parent 50b6400 commit e8f8958

2 files changed

Lines changed: 121 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
schedule:
11+
- cron: '0 2 * * 1' # At 02:00 on Monday
12+
13+
permissions: {}
14+
15+
jobs:
16+
test:
17+
name: Test
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 15
20+
strategy:
21+
matrix:
22+
node-version: [10, 12, 14, 16, 17, 18]
23+
db-image:
24+
- elasticsearch:7.17.3
25+
- elasticsearch:8.2.0
26+
- opensearchproject/opensearch:1.3.2
27+
fail-fast: false
28+
services:
29+
db:
30+
image: ${{ matrix.db-image }}
31+
ports: ["9200:9200"]
32+
steps:
33+
- uses: actions/checkout@v3
34+
- name: Use Node.js ${{ matrix.node-version }}
35+
uses: actions/setup-node@v3
36+
with:
37+
node-version: ${{ matrix.node-version }}
38+
- name:
39+
uses: supercharge/mongodb-github-action@1.6.0
40+
with:
41+
mongodb-version: ${{ matrix.mongodb-version }}
42+
- name: Bootstrap project
43+
run: npm ci --ignore-scripts
44+
- name: Run tests
45+
run: npm test
46+
- name: Publish coverage report to Coveralls
47+
uses: coverallsapp/github-action@master
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
flag-name: run-es@${{ matrix.db-version }}-node@${{ matrix.node-version }}
51+
parallel: true
52+
53+
posttest:
54+
name: Post-Test
55+
needs: test
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Coveralls finished
59+
uses: coverallsapp/github-action@master
60+
with:
61+
github-token: ${{ secrets.github_token }}
62+
parallel-finished: true
63+
64+
code-lint:
65+
name: Code Lint
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v3
69+
- name: Use Node.js 16
70+
uses: actions/setup-node@v3
71+
with:
72+
node-version: 16
73+
- name: Bootstrap project
74+
run: npm ci --ignore-scripts
75+
- name: Verify code linting
76+
run: npm run lint
77+
78+
commit-lint:
79+
name: Commit Lint
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v3
83+
with:
84+
fetch-depth: 0
85+
- name: Use Node.js 16
86+
uses: actions/setup-node@v3
87+
with:
88+
node-version: 16
89+
- name: Bootstrap project
90+
run: npm ci --ignore-scripts
91+
- name: Verify commit linting
92+
run: |
93+
npm exec \
94+
--no-install \
95+
--package=@commitlint/cli \
96+
-- \
97+
commitlint \
98+
--verbose \
99+
--from=origin/master \
100+
--to=HEAD
101+
102+
codeql:
103+
name: CodeQL
104+
runs-on: ubuntu-latest
105+
permissions:
106+
# See: https://github.com/github/codeql-action/blob/008b2cc71c4cf3401f45919d8eede44a65b4a322/README.md#usage
107+
security-events: write
108+
steps:
109+
- name: Checkout repository
110+
uses: actions/checkout@v3
111+
112+
- name: Initialize CodeQL
113+
uses: github/codeql-action/init@v1
114+
with:
115+
languages: 'javascript'
116+
config-file: ./.github/codeql/codeql-config.yml
117+
118+
- name: Perform CodeQL Analysis
119+
uses: github/codeql-action/analyze@v1

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package-lock=true
2+
scripts-prepend-node-path=true

0 commit comments

Comments
 (0)