FROM feat/485-user-env TO development #1006
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: Test | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| paths-ignore: | |
| - 'Changelog.md' | |
| - 'docker/**' | |
| - 'docker-compose.yml' | |
| - 'docs/**' | |
| - '.dockerignore' | |
| - 'README.md' | |
| - 'deployment/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| paths-ignore: | |
| - 'Changelog.md' | |
| - 'docker/**' | |
| - 'docker-compose.yml' | |
| - 'docs/**' | |
| - '.dockerignore' | |
| - 'README.md' | |
| - 'deployment/**' | |
| jobs: | |
| ############################################################### | |
| ## Test Frontend | |
| ############################################################### | |
| test-frontend: | |
| runs-on: ubuntu-latest | |
| environment: Test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Cache Node dependencies | |
| id: cache-node | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install dependencies | |
| working-directory: ./frontend | |
| if: steps.cache-node.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Save Node dependencies cache | |
| if: steps.cache-node.outputs.cache-hit != 'true' | |
| id: save-cache-node | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| **/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| - name: Run tests | |
| working-directory: ./frontend | |
| run: npm test | |
| - name: Build frontend | |
| working-directory: ./frontend | |
| run: npm run build | |
| ############################################################### | |
| ## Test Backend use Cache | |
| ############################################################### | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| environment: Test | |
| env: | |
| APP_ENV: test | |
| APP_LOG_LEVEL: debug | |
| APP_SECRET_KEY: ${{ secrets.APP_SECRET_KEY }} | |
| POSTGRES_CONNECTION_STRING: ${{ secrets.POSTGRES_CONNECTION_STRING }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| # services: | |
| # postgres: | |
| # image: pgvector/pgvector:pg16 | |
| # env: | |
| # POSTGRES_USER: admin | |
| # POSTGRES_PASSWORD: test1234 | |
| # POSTGRES_DB: lg_template_test | |
| # ports: | |
| # - 5432:5432 | |
| # options: >- | |
| # --health-cmd pg_isready | |
| # --health-interval 10s | |
| # --health-timeout 5s | |
| # --health-retries 5 | |
| # redis: | |
| # image: redis:alpine | |
| # ports: | |
| # - 6379:6379 | |
| # options: >- | |
| # --health-cmd "redis-cli ping" | |
| # --health-interval 10s | |
| # --health-timeout 5s | |
| # --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Cache Python dependencies | |
| id: cache-python | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| working-directory: ./backend | |
| run: | | |
| env | sort | |
| mkdir -p src/public/docs | |
| mkdir -p src/public/assets | |
| pip install --upgrade pip | |
| pip install uv | |
| uv sync --frozen --no-cache --dev | |
| - name: Save Python dependencies cache | |
| if: steps.cache-python.outputs.cache-hit != 'true' | |
| id: save-cache-python | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} | |
| - name: Run tests | |
| working-directory: ./backend | |
| env: | |
| PYTHONPATH: ./src:. | |
| run: | | |
| # Create the database directory | |
| mkdir -p ./docker/postgres/data | |
| # Run your tests | |
| uv run pytest -rs |