WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 3f9dbc1

Browse files
committed
feat: add CI Pipeline
0 parents  commit 3f9dbc1

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

.github/workflows/pipeline.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v5
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: 20
19+
20+
- name: Install Dependencies
21+
run: npm install
22+
23+
- name: Run Tests
24+
run: npm run test

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
console.log("Hello DevOps!")
2+
console.log("I'm learning CI/CD using GitHub Actions")

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "devops",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"run": "node index.js",
8+
"test": "node test.js"
9+
},
10+
"keywords": [],
11+
"author": "",
12+
"license": "ISC"
13+
}

test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
console.log("Starting the test...")
2+
setTimeout(() => { console.log("Waiting for 3 seconds...") }, 3000)
3+
console.log("Test completed!")

0 commit comments

Comments
 (0)