feat: convert state-sync effects to derived values, add useMountEffec… #1828
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: | |
| # Run on pushes to any branch, including namespaced branches like feat/foo. | |
| - "**" | |
| paths-ignore: | |
| - "Changelog.md" | |
| - "docker/**" | |
| - "docker-compose.yml" | |
| - "decks/**" | |
| - ".dockerignore" | |
| - "README.md" | |
| - "deployment/**" | |
| - "examples/**" | |
| - "openspec/**" | |
| - "cli/**" | |
| - "website/**" | |
| - "sandboxes/**" | |
| - "wiki/**" | |
| 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: postgresql://admin:test1234@localhost:5432/lg_template_test | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| REDIS_URL: redis://localhost:6379/0 | |
| 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 --extra api | |
| - 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: Wait for PostgreSQL | |
| run: | | |
| timeout 30 bash -c 'until pg_isready -h localhost -p 5432 -U admin; do sleep 1; done' | |
| - name: Run database migrations | |
| working-directory: ./backend | |
| env: | |
| PYTHONPATH: ./src:. | |
| run: | | |
| uv run alembic upgrade head | |
| - 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 |