Skip to content

Commit

Permalink
modify ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
LinboLen committed Jul 6, 2024
1 parent ddd0710 commit b89495a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 26 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ jobs:
with:
node-version: 20
cache: 'yarn'

- uses: actions/cache@v2
id: yarn-cache
with:
path: |
node_modules
**/node_modules
key: "${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}"
restore-keys: "${{ runner.os }}-yarn-\n"
- run: yarn install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

Expand Down
50 changes: 25 additions & 25 deletions apps/startkit/src/app/app.controller.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import {faker} from '@faker-js/faker';
import {schema} from '@gradii/fedaco';
import {Controller, Get} from '@nestjs/common';
import {UserModel} from './models/user.model';
import { faker } from '@faker-js/faker';
import { db, schema } from '@gradii/fedaco';
import { Controller, Get } from '@nestjs/common';
import { UserModel } from './models/user.model';

@Controller()
export class AppController {
constructor() {
}
constructor() {
}

@Get('/init-table')
async initTable() {
if (!await schema().hasTable('users')) {
await schema().create('users', table => {
table.increments('id');
table.string('username');
table.timestamps();
});
}
@Get('/init-table')
async initTable() {
if (!await schema().hasTable('users')) {
await schema().create('users', table => {
table.increments('id');
table.string('username');
table.timestamps();
});
}
}

@Get('/add-user')
async addUser() {
await UserModel.createQuery().create({
username: faker.finance.accountName()
});
}
@Get('/add-user')
async addUser() {
await UserModel.createQuery().create({
username: faker.finance.accountName()
});
}

@Get('/list-user')
async listUsers() {
return await UserModel.createQuery().get();
}
@Get('/list-user')
async listUsers() {
return await UserModel.createQuery().get();
}
}

0 comments on commit b89495a

Please sign in to comment.