Fix account creation authentication state #88
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: | |
| - '**' | |
| pull_request: | |
| release: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.event_name != 'release' }} | |
| jobs: | |
| docs: | |
| name: Docs Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: apps/docs/package-lock.json | |
| - name: Install docs dependencies | |
| working-directory: apps/docs | |
| run: npm ci | |
| - name: Build docs | |
| working-directory: apps/docs | |
| run: npm run docs:build | |
| hydroserver-ts: | |
| name: TypeScript Client | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: packages/hydroserver-ts/package-lock.json | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install API dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r django/requirements.txt | |
| pip install -e packages/hydroserverpy | |
| - name: Install client dependencies | |
| working-directory: packages/hydroserver-ts | |
| run: npm ci | |
| - name: Verify TypeScript client contract artifacts | |
| working-directory: packages/hydroserver-ts | |
| run: npm run check:contract | |
| - name: Run TypeScript client tests | |
| working-directory: packages/hydroserver-ts | |
| run: npm run coverage | |
| - name: Build TypeScript client | |
| working-directory: packages/hydroserver-ts | |
| run: npm run build | |
| data-management: | |
| name: Data Management App | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| apps/data-management/package-lock.json | |
| packages/hydroserver-ts/package-lock.json | |
| - name: Install TypeScript client dependencies | |
| working-directory: packages/hydroserver-ts | |
| run: npm ci | |
| - name: Install app dependencies | |
| working-directory: apps/data-management | |
| run: npm ci | |
| - name: Configure app environment | |
| working-directory: apps/data-management | |
| run: | | |
| { | |
| echo "VITE_APP_VERSION=ci" | |
| echo "VITE_APP_GOOGLE_MAPS_API_KEY=" | |
| echo "VITE_APP_GOOGLE_MAPS_MAP_ID=" | |
| echo "VITE_APP_PROXY_BASE_URL=http://127.0.0.1:8000" | |
| echo "VITE_HYDROSERVER_CLIENT_LOCAL=1" | |
| echo "VITE_HYDROSERVER_CLIENT_PATH=../../packages/hydroserver-ts/src" | |
| } > .env | |
| - name: Run app tests | |
| working-directory: apps/data-management | |
| run: npm run coverage | |
| - name: Build app | |
| working-directory: apps/data-management | |
| run: npm run build | |
| hydroserverpy: | |
| name: Python Client | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install Python client dependencies | |
| working-directory: packages/hydroserverpy | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest | |
| - name: Run Python client tests | |
| working-directory: packages/hydroserverpy | |
| run: python -m pytest --import-mode=append tests/ | |
| api: | |
| name: API Service | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: hydroserver | |
| POSTGRES_USER: hsdbadmin | |
| POSTGRES_PASSWORD: admin | |
| options: >- | |
| --health-cmd "pg_isready -U hsdbadmin -d hydroserver" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis:7 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| mailhog: | |
| image: mailhog/mailhog:latest | |
| ports: | |
| - 1025:1025 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install API dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r django/requirements.txt | |
| pip install -e packages/hydroserverpy | |
| pip install pytest pytest-django pytest-cov | |
| - name: Run API test suite | |
| working-directory: django | |
| env: | |
| DATABASE_URL: postgresql://hsdbadmin:admin@127.0.0.1:5432/hydroserver | |
| CELERY_BROKER_URL: redis://127.0.0.1:6379/0 | |
| SMTP_URL: smtp://127.0.0.1:1025 | |
| run: python -m pytest | |
| e2e: | |
| name: End-to-End Tests | |
| runs-on: ubuntu-latest | |
| env: | |
| E2E_DATABASE_URL: postgresql://hsdbadmin:admin@127.0.0.1:5432/hydroserver_e2e_${{ github.run_id }}_${{ github.run_attempt }} | |
| E2E_ADMIN_DATABASE_URL: postgresql://hsdbadmin:admin@127.0.0.1:5432/postgres | |
| services: | |
| postgres: | |
| image: postgres:17 | |
| env: | |
| POSTGRES_DB: hydroserver | |
| POSTGRES_USER: hsdbadmin | |
| POSTGRES_PASSWORD: admin | |
| options: >- | |
| --health-cmd "pg_isready -U hsdbadmin -d hydroserver" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis:7 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: | | |
| apps/data-management/package-lock.json | |
| packages/hydroserver-ts/package-lock.json | |
| tests/e2e/package-lock.json | |
| - name: Install API dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r django/requirements.txt | |
| pip install -e packages/hydroserverpy | |
| - name: Install TypeScript client dependencies | |
| working-directory: packages/hydroserver-ts | |
| run: npm ci | |
| - name: Install app dependencies | |
| working-directory: apps/data-management | |
| run: npm ci | |
| - name: Install E2E dependencies | |
| working-directory: tests/e2e | |
| run: npm ci | |
| - name: Install Playwright browser | |
| working-directory: tests/e2e | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright E2E suite | |
| env: | |
| E2E_PYTHON: python | |
| run: ./scripts/e2e test | |
| - name: Upload Playwright report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: | | |
| tests/e2e/playwright-report | |
| tests/e2e/test-results | |
| if-no-files-found: ignore | |
| trigger-release: | |
| name: Trigger Release Workflow | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| needs: [docs, hydroserver-ts, data-management, hydroserverpy, api, e2e] | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Trigger release workflow | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| await github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'release.yml', | |
| ref: context.payload.release.target_commitish, | |
| inputs: { | |
| tag: context.payload.release.tag_name, | |
| prerelease: String(context.payload.release.prerelease), | |
| }, | |
| }); |