refactor(training): migrate workout programming model to block-based … #370
Workflow file for this run
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: | |
| pull_request: | |
| branches: | |
| - develop | |
| jobs: | |
| lint: | |
| name: Lint Codebase | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run lint | |
| run: pnpm run lint | |
| build: | |
| name: Build Project | |
| runs-on: ubuntu-latest | |
| needs: lint | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run build | |
| run: pnpm build | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: build | |
| services: | |
| test-db: | |
| image: postgres:15-alpine | |
| ports: | |
| - 5433:5432 | |
| env: | |
| NODE_ENV: test | |
| POSTGRES_DB: dropit_test | |
| POSTGRES_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| options: >- | |
| --health-cmd="pg_isready -U postgres" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 22 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build dependencies | |
| run: pnpm run build | |
| - name: Check database migrations | |
| working-directory: apps/api | |
| run: | | |
| if [ -n "$(find src/modules/db/migrations -name '*.ts' -not -name '.gitkeep' 2>/dev/null)" ]; then | |
| pnpm run db:migration:check | |
| pnpm run db:migration:up | |
| else | |
| echo "No migrations found, skipping migration checks (prototyping phase)" | |
| fi | |
| env: | |
| API_PORT: 3001 | |
| NODE_ENV: test | |
| DB_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| DB_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| DB_NAME: dropit_test | |
| DB_HOST: localhost | |
| DB_PORT: 5433 | |
| BETTER_AUTH_SECRET: test-secret-for-ci | |
| TRUSTED_ORIGINS: "http://localhost:3000" | |
| - name: Run api tests | |
| working-directory: apps/api | |
| run: | | |
| pnpm run test:unit | |
| pnpm run test:integration | |
| env: | |
| API_PORT: 3001 | |
| NODE_ENV: test | |
| DB_USER: ${{ secrets.TEST_POSTGRES_USER }} | |
| DB_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }} | |
| DB_NAME: dropit_test | |
| DB_HOST: localhost | |
| DB_PORT: 5433 | |
| BETTER_AUTH_SECRET: test-secret-for-ci | |
| TRUSTED_ORIGINS: "http://localhost:3000" |