Skip to content

Commit f87ce1c

Browse files
committed
Update the github workflow
1 parent b46012d commit f87ce1c

File tree

5 files changed

+59
-13
lines changed

5 files changed

+59
-13
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: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
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-
name: Run Tests
12-
runs-on: ubuntu-latest
13-
steps:
14-
# checkout the code
15-
- uses: actions/checkout@v2
16-
# setup the nodejs environment
17-
- uses: actions/setup-node@v2
18-
with:
19-
node-version: 16
20-
- run: npm install
21-
- 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

0 commit comments

Comments
 (0)