pdf functionality #9
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: CI Pipeline | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| backend-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install C++ dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential g++ | |
| - name: Install Python dependencies | |
| run: | | |
| cd backend | |
| pip install -r requirements.txt | |
| - name: Build C++ code | |
| run: | | |
| cd backend | |
| make | |
| - name: Run backend tests | |
| run: | | |
| cd backend/test | |
| python -m unittest discover | |
| continue-on-error: true | |
| frontend-build: | |
| runs-on: ubuntu-latest | |
| env: | |
| NEXT_PUBLIC_OPENAI_API_KEY: ${{ secrets.NEXT_PUBLIC_OPENAI_API_KEY }} | |
| DOMAIN: ${{ secrets.DOMAIN }} | |
| EMAIL_USER: ${{ secrets.EMAIL_USER }} | |
| MAILTRAP_PASS: ${{ secrets.MAILTRAP_PASS }} | |
| MAILTRAP_USER: ${{ secrets.MAILTRAP_USER }} | |
| MONGODB_URI: ${{ secrets.MONGODB_URI }} | |
| NODE_ENV: ${{ secrets.NODE_ENV }} | |
| PORT: ${{ secrets.PORT }} | |
| TOKEN_SECRET: ${{ secrets.TOKEN_SECRET }} | |
| WEBSITE_URL: ${{ secrets.WEBSITE_URL }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18.x' | |
| - name: Install dependencies | |
| run: | | |
| cd frontend | |
| npm ci --legacy-peer-deps | |
| - name: Run ESLint (informational only) | |
| run: | | |
| cd frontend | |
| npm run lint || echo "ESLint found issues, but continuing build" | |
| continue-on-error: true | |
| - name: Build frontend | |
| run: | | |
| cd frontend | |
| # Create a temporary .env file for the build process | |
| echo "# CI/CD temporary environment variables" > .env | |
| SKIP_ESLINT=1 npm run build | |
| - name: Run frontend tests | |
| run: | | |
| cd frontend | |
| npm test | |
| continue-on-error: true |