Skip to content

Commit 389c0bb

Browse files
authored
Merge pull request #3 from rudSarkar/dev
Added a test case for not merging into main
2 parents c7b2e99 + a567ccc commit 389c0bb

File tree

6 files changed

+61
-14
lines changed

6 files changed

+61
-14
lines changed

.github/workflows/checkout_code.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Installing Node.js Packages
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Installing Node.js Packages
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2

.github/workflows/ci.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
name: nodejs-ci
1+
name: Node.js CI
22

33
on:
4-
# Trigger when a new commit is pushed in main branch
4+
# Trigger when a new pull request in main branch
55
pull_request:
66
branches:
77
- main
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
steps:
13-
# checkout the code
14-
- uses: actions/checkout@v2
15-
# setup the nodejs environment
16-
- uses: actions/setup-node@v2
17-
with:
18-
node-version: 16
19-
- run: npm install
20-
- run: npm run test
10+
checkout_code:
11+
name: Checkout Code
12+
uses: ./github/workflows/checkout_code.yml
13+
setup_node:
14+
name: Installing Node.js
15+
uses: ./github/workflows/setup_node.yml
16+
install_packages:
17+
name: Installing Node.js Packages
18+
uses: ./github/workflows/install_packages.yml
19+
run_test:
20+
name: Run Test Case in Node.js Application
21+
uses: ./github/workflows/run_test.yml
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Installing Node.js Packages
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Installing Node.js Packages
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: npm install

.github/workflows/run_test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Run Node.js Project Test Cases
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Run Node.js Project Test Cases
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: npm test

.github/workflows/setup_node.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Setup Node.js
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build:
8+
name: Installing Node
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/setup-node@v2
12+
with:
13+
node-version: 16

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe("/GET /dev", () => {
3838
.get("/dev")
3939
.end((err, res) => {
4040
res.should.have.status(200);
41-
res.text.should.be.eql("Hello 2");
41+
res.text.should.be.eql("dev");
4242
done();
4343
});
4444
});

0 commit comments

Comments
 (0)