Refactor Spectrum schema, and spectrum submit form (#396) #1151
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 | |
| # Enable Buildkit and let compose use it to speed up image building | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| COMPOSE_DOCKER_CLI_BUILD: 1 | |
| # postgres://user:password@host:port/database | |
| DATABASE_URL: "postgres://postgres:postgres@localhost:5432/postgres" | |
| UV_FROZEN: 1 | |
| NCBI_API_KEY: ${{ secrets.NCBI_API_KEY }} | |
| on: | |
| pull_request: | |
| branches: ["develop", "main"] | |
| push: | |
| branches: ["develop", "main"] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| typing: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code Repository | |
| uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Run basedpyright | |
| run: uv run --group typing --no-dev basedpyright | |
| typing-typescript: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: package.json | |
| cache: "pnpm" | |
| - name: Install node Dependencies | |
| run: pnpm install | |
| - name: Run TypeScript type checking | |
| run: pnpm typecheck | |
| check-migrations: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code Repository | |
| uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| enable-cache: true | |
| - name: Check for new migrations | |
| run: uv run backend/manage.py makemigrations --check --noinput | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: latest | |
| enable-cache: true | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: package.json | |
| cache: "pnpm" | |
| - name: Install node Dependencies | |
| run: pnpm install | |
| - name: Test | |
| run: | | |
| uv sync --group test --no-dev | |
| uv run --no-sync pytest -n auto -v --cov --cov-report=xml | |
| - name: coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| test-e2e: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| browser: [chromium, firefox, webkit] | |
| services: | |
| postgres: | |
| image: postgres:15 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: latest | |
| enable-cache: true | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: package.json | |
| cache: "pnpm" | |
| - name: Install node Dependencies | |
| run: pnpm install | |
| - run: uv sync --group test --no-dev | |
| - name: Ensure browsers are installed | |
| run: uv run --no-sync playwright install ${{ matrix.browser }} --with-deps | |
| - name: Test | |
| run: uv run --no-sync pytest backend/tests_e2e/ --create-db --migrations -v --browser ${{ matrix.browser }} --cov --cov-report=xml --tracing=retain-on-failure | |
| - uses: actions/upload-artifact@v5 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-traces-${{ matrix.browser }} | |
| path: test-results/ | |
| - name: coverage | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |