diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 001ce2139b..89c522ab61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -223,15 +223,27 @@ jobs: --health-retries 5 ports: - 5432:5432 + defaults: + run: + working-directory: ./server + steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 + - name: Install server dependencies - run: npm --prefix server ci + run: npm ci + + - name: Build the + run: npm run build + - name: Run existing migrations - run: npm --prefix server run typeorm:migrations:run + run: npm run typeorm:migrations:run + - name: Generate new migrations continue-on-error: true - run: npm --prefix server run typeorm:migrations:generate ./src/infra/migrations/TestMigration + run: npm run typeorm:migrations:generate ./src/infra/migrations/TestMigration + - name: Find file changes uses: tj-actions/verify-changed-files@v13.1 id: verify-changed-files diff --git a/server/package.json b/server/package.json index f1eb994828..d2e78fabea 100644 --- a/server/package.json +++ b/server/package.json @@ -27,12 +27,12 @@ "test:cov": "jest --coverage", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:e2e": "jest --config test/e2e/jest-e2e.json --runInBand", - "typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js", - "typeorm:migrations:create": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:create", - "typeorm:migrations:generate": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:generate -d ./src/infra/database.config.ts", - "typeorm:migrations:run": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:run -d ./src/infra/database.config.ts", - "typeorm:migrations:revert": "node --require ts-node/register ./node_modules/typeorm/cli.js migration:revert -d ./src/infra/database.config.ts", - "typeorm:schema:drop": "node --require ts-node/register ./node_modules/typeorm/cli.js schema:drop -d ./src/infra/database.config.ts", + "typeorm": "typeorm", + "typeorm:migrations:create": "typeorm migration:create", + "typeorm:migrations:generate": "typeorm migration:generate -d ./dist/infra/database.config.js", + "typeorm:migrations:run": "typeorm migration:run -d ./dist/infra/database.config.js", + "typeorm:migrations:revert": "typeorm migration:revert -d ./dist/infra/database.config.js", + "typeorm:schema:drop": "typeorm schema:drop -d ./dist/infra/database.config.js", "typeorm:schema:reset": "npm run typeorm:schema:drop && npm run typeorm:migrations:run", "api:typescript": "bash ./bin/generate-open-api.sh web", "api:dart": "bash ./bin/generate-open-api.sh mobile",