fix: recipe layout mobile fixes #667
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 | ||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| # Set environment variables at the job level | ||
| env: | ||
| DATABASE_URL: postgres://postgres:postgres@localhost:5433/forkly | ||
| SPOONACULAR_API_KEY: ${{ secrets.SPOONACULAR_API_KEY }} | ||
| CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }} | ||
| CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }} | ||
| CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }} | ||
| GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | ||
| GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | ||
| RESEND_API_KEY: ${{ secrets.RESEND_API_KEY }} | ||
| APP_URL: ${{ vars.APP_URL }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| KV_REST_API_URL: ${{ secrets.KV_REST_API_URL }} | ||
| KV_REST_API_TOKEN: ${{ secrets.KV_REST_API_TOKEN }} | ||
| REDIS_URL: ${{ secrets.REDIS_URL }} | ||
| services: | ||
| postgres: | ||
| image: postgres:14 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: forkly | ||
| ports: | ||
| - 5433:5432 | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| redis: | ||
| image: redis:6 | ||
| ports: | ||
| - 6379:6379 | ||
| command: redis-server --requirepass redis_password --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes | ||
| options: >- | ||
| --health-cmd "redis-cli -a redis_password ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'pnpm' | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v2 | ||
| with: | ||
| version: 8 | ||
| - name: Create .env file | ||
| run: | | ||
| echo "DATABASE_URL=${{ env.DATABASE_URL }}" >> .env | ||
| echo "SPOONACULAR_API_KEY=${{ env.SPOONACULAR_API_KEY }}" >> .env | ||
| echo "CLOUDINARY_CLOUD_NAME=${{ env.CLOUDINARY_CLOUD_NAME }}" >> .env | ||
| echo "CLOUDINARY_API_KEY=${{ env.CLOUDINARY_API_KEY }}" >> .env | ||
| echo "CLOUDINARY_API_SECRET=${{ env.CLOUDINARY_API_SECRET }}" >> .env | ||
| echo "GOOGLE_CLIENT_ID=${{ env.GOOGLE_CLIENT_ID }}" >> .env | ||
| echo "GOOGLE_CLIENT_SECRET=${{ env.GOOGLE_CLIENT_SECRET }}" >> .env | ||
| echo "RESEND_API_KEY=${{ env.RESEND_API_KEY }}" >> .env | ||
| echo "APP_URL=${{ env.APP_URL }}" >> .env | ||
| echo "OPENAI_API_KEY=${{ env.OPENAI_API_KEY }}" >> .env | ||
| echo "KV_REST_API_URL=${{ env.KV_REST_API_URL }}" >> .env | ||
| echo "KV_REST_API_TOKEN=${{ env.KV_REST_API_TOKEN }}" >> .env | ||
| echo "REDIS_URL=${{ env.REDIS_URL }}" >> .env | ||
| - name: Install dependencies | ||
| run: pnpm install | ||
| - name: Type and Svelte checks | ||
| run: pnpm exec svelte-check --tsconfig ./tsconfig.json --fail-on-warnings | ||
| - name: Build | ||
| run: pnpm build | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: test_db | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| redis: | ||
| image: redis:6 | ||
| ports: | ||
| - 6379:6379 | ||
| command: redis-server --requirepass redis_password --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes | ||
| options: >- | ||
| --health-cmd "redis-cli -a redis_password ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| cache: 'pnpm' | ||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v2 | ||
| with: | ||
| version: 8 | ||
| - name: Install dependencies | ||
| run: pnpm install | ||
| - name: Create .env.test file | ||
| run: | | ||
| echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/test_db" >> .env.test | ||
| echo "REDIS_URL=redis://:redis_password@localhost:6379" >> .env.test | ||
| - name: Run database migrations | ||
| run: pnpm db:push | ||
| - name: Run tests | ||
| run: pnpm test | ||