diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml new file mode 100644 index 0000000..bf87787 --- /dev/null +++ b/.github/workflows/pr-validation.yml @@ -0,0 +1,54 @@ +name: PR Validation + +on: + pull_request: + branches: [ main ] + +jobs: + frontend-check: + name: Frontend Build and Lint Validation + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + cache-dependency-path: frontend/package-lock.json + + - name: Install Frontend Dependencies + run: npm ci + working-directory: frontend + + - name: Lint Frontend + run: npm run lint + working-directory: frontend + + - name: Build Frontend + run: npm run build + working-directory: frontend + + backend-check: + name: Backend Syntax and Dependencies Validation + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + cache-dependency-path: server/package-lock.json + + - name: Install Backend Dependencies + run: npm ci + working-directory: server + + - name: Verify Backend Entry Point Syntax + run: node --check server.js + working-directory: server