fix: nginx.conf #24
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| lint-and-typecheck: | |
| name: Lint and Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run type check | |
| run: npm run type-check | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests | |
| run: npm run test:unit | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npm run build | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Start backend services | |
| run: docker compose up -d --wait | |
| - name: Wait for admin account to be seeded | |
| run: | | |
| echo "Waiting for admin account to be available..." | |
| for i in {1..10}; do | |
| if curl -s -X POST http://localhost:8080/api/authenticate \ | |
| -H "Content-Type: application/json" \ | |
| -d '{"tenantId":"00000000-0000-0000-0000-000000000000","email":"testadmin@latebit.io","password":"test1234!","clientId":"admin-client"}' \ | |
| | grep -q "accessToken"; then | |
| echo "Admin account is ready!" | |
| exit 0 | |
| fi | |
| echo "Attempt $i: Admin account not ready yet, waiting..." | |
| sleep 5 | |
| done | |
| echo "Admin account did not become available" | |
| docker compose logs | |
| exit 1 | |
| - name: Run integration tests | |
| run: npm run test:integration | |
| env: | |
| TEST_SYSTEM_ADMIN_EMAIL: testadmin@latebit.io | |
| TEST_SYSTEM_ADMIN_PASSWORD: test1234! | |
| TEST_SYSTEM_ADMIN_CLIENT_ID: admin-client | |
| - name: Show logs on failure | |
| if: failure() | |
| run: | | |
| echo "=== MongoDB logs ===" | |
| docker compose logs mongodb | |
| echo "=== Bulwark Auth logs ===" | |
| docker compose logs bulwarkauth | |
| echo "=== Bulwark Admin logs ===" | |
| docker compose logs bulwarkauthadmin | |
| - name: Stop backend services | |
| if: always() | |
| run: docker compose down -v |