Free evals #545
This file contains hidden or 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
name: Prettier and Build Check | |
on: | |
pull_request: | |
branches: [main] | |
push: | |
branches: [main] | |
jobs: | |
prettier-and-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: | | |
# Clean npm cache | |
npm cache clean --force | |
# Remove lock files and node_modules to ensure fresh install | |
rm -rf package-lock.json node_modules | |
rm -rf client/package-lock.json client/node_modules | |
rm -rf server/package-lock.json server/node_modules | |
# Install all dependencies (root + client + server) | |
npm install --legacy-peer-deps | |
cd client && npm install --legacy-peer-deps && cd .. | |
cd server && npm install --legacy-peer-deps && cd .. | |
- name: Check Prettier formatting | |
run: | | |
if ! npx prettier --check .; then | |
echo "❌ Code is not properly formatted!" | |
echo "" | |
echo "To fix this, run:" | |
echo " npm run prettier-fix" | |
echo "" | |
echo "Then commit and push the changes." | |
exit 1 | |
else | |
echo "✅ All files are properly formatted!" | |
fi | |
- name: Build project | |
run: | | |
echo "🏗️ Building project..." | |
npm run build | |
echo "✅ Build completed successfully!" |