Skip to content

Commit

Permalink
Merge pull request #5 from naumanzchaudhry/phase-1/1-pipeline-commit
Browse files Browse the repository at this point in the history
[Phase # 1] - Pipeline Commit Stage
  • Loading branch information
naumanzchaudhry authored Oct 3, 2024
2 parents 43f56ce + 189fc49 commit 773a7b7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 7 deletions.
30 changes: 23 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,48 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
node-version: "18"

# Step 3: Install dependencies (npm or yarn based on your setup)
- name: Install dependencies
run: npm install

# Step 4: Run tests
- name: Run tests
# Step 4: Run all tests
- name: Run all tests
run: npm run test

# Step 5: Set up Docker
# Step 5: Run Unit Tests
- name: Run Unit Tests
run: npm run test:unit

# Step 6: Run Integration Tests
- name: Run Integration Tests
run: npm run test:integration

# Step 7: Run Component Tests
- name: Run Component Tests
run: npm run test:component

# Step 8: Run Contract Tests
- name: Run Contract Tests
run: npm run test:contract

# Step 9: Set up Docker
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 6: Log in to Docker Hub
# Step 10: Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# Step 7: Build the Docker image
# Step 11: Build the Docker image
- name: Build Docker image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/tasker-api:${{ github.sha }} .

# Step 8: Push the Docker image to Docker Hub
# Step 12: Push the Docker image to Docker Hub
- name: Push Docker image to Docker Hub
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/tasker-api:${{ github.sha }}

Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
"main": "index.js",
"scripts": {
"dev": "nodemon ./server.js",
"test:unit": "vitest run tests/unit/**/*.unit.spec.ts tests/unit/*.unit.spec.ts",
"test:integration": "vitest run tests/integration/**/*.integration.spec.ts tests/integration/*.integration.spec.ts",
"test:component": "vitest run tests/component/**/*.component.spec.ts tests/component/*.component.spec.ts",
"test:contract": "vitest run tests/contract/**/*.contract.spec.ts tests/contract/*.contract.spec.ts",
"test": "vitest",
"test:watch": "vitest --watch"
},
Expand Down
8 changes: 8 additions & 0 deletions tests/component/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, it } from 'vitest'

describe('[Component] App', () => {
it('renders properly', () => {
// placeholder test
return true
})
})
8 changes: 8 additions & 0 deletions tests/contract/app.contract.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, it } from 'vitest'

describe('[Contract] App', () => {
it('renders properly', () => {
// placeholder test
return true
})
})
8 changes: 8 additions & 0 deletions tests/integration/app.integration.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, it } from 'vitest'

describe('[Integration] App', () => {
it('renders properly', () => {
// placeholder test
return true
})
})
8 changes: 8 additions & 0 deletions tests/unit/app.unit.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, it } from 'vitest'

describe('[Unit] App', () => {
it('renders properly', () => {
// placeholder test
return true
})
})

0 comments on commit 773a7b7

Please sign in to comment.