add sql model library #23
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: Full Stack CI/CD | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| backend-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Code Quality (Ruff & Black) | |
| run: | | |
| # Check linting and common errors with Ruff | |
| ruff check app/ tests/ | |
| # Ensure code is formatted correctly with Black | |
| black --check app/ tests/ | |
| - name: Run Backend Tests (with coverage) | |
| run: | | |
| python -m pytest tests/ --cov=app --cov-report=xml | |
| frontend-test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Lint Frontend | |
| run: npm run lint | |
| - name: Run Frontend Tests | |
| run: npm test -- run | |
| build-docker: | |
| needs: [backend-test, frontend-test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build Backend Image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./backend | |
| push: false | |
| tags: informa-truth-backend:latest | |
| - name: Build Frontend Image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: ./frontend | |
| push: false | |
| tags: informa-truth-frontend:latest |