-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: added github workflows to the project
- added build - added build, linter and tests for back - added linter for front closes #24
- Loading branch information
Showing
14 changed files
with
133 additions
and
129 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,18 @@ | ||
name: 'Install Node.js and dependencies' | ||
|
||
description: 'Set up Node and dependencies' | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18.17.0 | ||
- name: Install pnpm | ||
shell: bash | ||
run: npm install -g pnpm | ||
- name: Install dependencies | ||
shell: bash | ||
run: pnpm install |
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,33 @@ | ||
name: Backend Actions | ||
on: | ||
push: | ||
paths: | ||
- 'apps/api/**' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node and dependencies | ||
uses: ./.github/actions/install | ||
- name: Run build | ||
run: pnpm dlx nx build api | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node and dependencies | ||
uses: ./.github/actions/install | ||
- name: Run lint | ||
run: pnpm dlx nx lint api | ||
integration-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node and dependencies | ||
uses: ./.github/actions/install | ||
- name: Run integration tests | ||
run: export NODE_ENV=development && pnpm dlx nx test:integration api |
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,15 @@ | ||
name: Frontend Actions | ||
on: | ||
push: | ||
paths: | ||
- 'apps/web/**' | ||
jobs: | ||
linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Install Node and dependencies | ||
uses: ./.github/actions/install | ||
- name: Run lint | ||
run: pnpm dlx nx lint web |
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,60 @@ | ||
import { Test } from '@nestjs/testing'; | ||
import { MessageModule } from '../message/message.module'; | ||
import { BidModule } from '../bid/bid.module'; | ||
import { FileModule } from '../../file/file.module'; | ||
import { AuctionGateway } from './gateways/auction.gateway'; | ||
import { AuctionService } from './auction.service'; | ||
import { AuctionMapper } from './auction.mapper'; | ||
import { messageProviders } from '../../database/providers/message.provider'; | ||
import { bidProviders } from '../../database/providers/bid.provider'; | ||
import { auctionProviders } from '../../database/providers/auction.provider'; | ||
import { photoProviders } from '../../database/providers/photo.provider'; | ||
import { DatabaseModule } from '../../database/database.module'; | ||
import { Auction } from '../../database/entities/auction.entity'; | ||
|
||
describe('Auction integration test', () => { | ||
let auctionService: AuctionService; | ||
let auction; | ||
beforeAll(async () => { | ||
const moduleRef = await Test.createTestingModule({ | ||
providers: [ | ||
AuctionGateway, | ||
AuctionService, | ||
AuctionMapper, | ||
...messageProviders, | ||
...bidProviders, | ||
...auctionProviders, | ||
...photoProviders, | ||
], | ||
imports: [MessageModule, BidModule, FileModule, DatabaseModule], | ||
}).compile(); | ||
auctionService = moduleRef.get<AuctionService>(AuctionService); | ||
|
||
auction = await auctionService.createAuction({ | ||
name: 'Vintage Painting Auction', | ||
startPrice: 100, | ||
stepPrice: 10, | ||
currentPrice: 100, | ||
endDate: '2024-12-31T23:59:59Z', | ||
description: 'A vintage painting from the 19th century.', | ||
} as Auction); | ||
}); | ||
|
||
it('should return auction', async () => { | ||
const gottenAuction = await auctionService.get(auction.id); | ||
|
||
expect(gottenAuction.dataValues).toEqual({ | ||
id: auction.id, | ||
userId: null, | ||
name: 'Vintage Painting Auction', | ||
startPrice: 100, | ||
stepPrice: 10, | ||
currentPrice: 100, | ||
endDate: auction.endDate, | ||
description: 'A vintage painting from the 19th century.', | ||
createdAt: auction.createdAt, | ||
updatedAt: auction.updatedAt, | ||
photos: [], | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
NEXT_PUBLIC_API_URL=http://localhost:3001 |
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
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