-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from DeepaPrasanna/development
build(backend): 👷 update github action
- Loading branch information
Showing
6 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: NestJS-UnitTest | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- development | ||
pull_request: | ||
branches: | ||
- main | ||
- development | ||
|
||
# Needed for nx-set-shas within nx-cloud-main.yml, when run on the main branch | ||
permissions: | ||
actions: read | ||
contents: read | ||
|
||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Restore cached npm dependencies | ||
id: cache-dependencies-restore | ||
uses: actions/cache/restore@v3 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }} | ||
- run: pnpm install --frozen-lockfile | ||
- name: Cache npm dependencies | ||
id: cache-dependencies-save | ||
uses: actions/cache/save@v3 | ||
with: | ||
path: | | ||
node_modules | ||
~/.cache/Cypress # needed for the Cypress binary | ||
key: ${{ steps.cache-dependencies-restore.outputs.cache-primary-key }} | ||
- uses: nrwl/nx-set-shas@v4.0.4 | ||
# This line is needed for nx affected to work when CI is running on a PR | ||
- run: git branch --track main origin/main | ||
- run: pnpm nx affected -t lint test build --parallel=3 | ||
- run: pnpm nx affected -t e2e --parallel=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Controller, Get } from '@nestjs/common'; | ||
|
||
@Controller() | ||
export class AppController { | ||
@Get('/') | ||
healthCheck(): string { | ||
return 'All working fine'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { Module } from '@nestjs/common'; | ||
|
||
import { AppController } from './app.controller'; | ||
|
||
@Module({ | ||
imports: [], | ||
controllers: [], | ||
controllers: [AppController], | ||
providers: [], | ||
}) | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters