Skip to content

Commit

Permalink
Added workflow to test problem directory
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalmishraa committed Jul 29, 2024
1 parent 4680f85 commit 4af67fb
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/deploy-problems.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ on:
- 'apps/boilerplate-generator/**'
- 'docker/problems/**'
- '.github/workflows/deploy-problems.yml'
pull_request:
branches:
- 'main'
paths:
- 'apps/problems/**'
- 'docker/problems/**'
- '.github/workflows/deploy-problems.yml'


jobs:
Deploy-sweeper:
name: Builds and pushes to Docker Hub
Expand All @@ -25,9 +18,6 @@ jobs:
- name: Checkout the Repository
uses: actions/checkout@v3

- name: Run test for Problems
run: npm install && cd apps/boilerplate-generator && npm run test

- name: Copy Docker image to root
run: cp ./docker/problems/Dockerfile .

Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/test-pronblems.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test Problem directory structure

on:
push:
branches:
- 'main'
paths:
- 'apps/problems/**'
- 'apps/boilerplate-generator/**'
- 'docker/problems/**'
- '.github/workflows/deploy-problems.yml'
pull_request:
branches:
- 'main'
paths:
- 'apps/problems/**'
- 'docker/problems/**'
- '.github/workflows/deploy-problems.yml'


jobs:
Deploy-sweeper:
name: Test Problem directory structure
runs-on: ubuntu-latest
steps:
- name: Checkout the Repository
uses: actions/checkout@v3

- name: Test problems directory
run: cd apps/boilerplate-generator && npm install && npm run test
4 changes: 2 additions & 2 deletions apps/boilerplate-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "yarn esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
"boiler:generate": "yarn run build && node dist/index.js",
"build": "npm esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
"boiler:generate": "npm run build && node dist/index.js",
"test": "npx vitest run",
"start": "npm run test && npm run boiler:generate"
},
Expand Down
2 changes: 1 addition & 1 deletion docker/problems/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /usr/src/app

RUN npm install

RUN cd ./apps/boilerplate-generator && npm run build && PROBLEMS_DIR_PATH=/usr/src/app/apps/problems node dist/index.js
RUN cd ./apps/boilerplate-generator && PROBLEMS_DIR_PATH=/usr/src/app/apps/problems npm run start

WORKDIR /usr/src/app

Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"dev:docker": "npm run prisma:docker && yarn dev",
"dev:docker": "npm run prisma:docker && npm dev",
"prisma:docker": "cd packages/db && npm prisma db push --force-reset && npm prisma db seed",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"start:web": "cd apps/web && npm run start",
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,6 @@ binary-extensions@^2.0.0:
dotenv "^16.4.5"
esbuild "^0.21.5"
fs "^0.0.1-security"
vitest "^2.0.4"

brace-expansion@^1.1.7:
version "1.1.11"
Expand Down

0 comments on commit 4af67fb

Please sign in to comment.