Repository navigation
test(relay): signal invite mint await instead of yield polling (#991) #2448
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 Checks | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - rewrite/main | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| name: Detect changed paths | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| src: ${{ steps.filter.outputs.src }} | |
| rust: ${{ steps.filter.outputs.rust }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| src: | |
| - 'src/**' | |
| - 'test/**' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - 'tsconfig*.json' | |
| - 'biome.json' | |
| - '.knip.json' | |
| - 'Dockerfile*' | |
| - 'docker-compose*.yml' | |
| - '.nvmrc' | |
| - 'resources/default-settings.yaml' | |
| - '.github/workflows/checks.yml' | |
| rust: | |
| - 'crates/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - 'rust-toolchain.toml' | |
| - 'resources/default-settings.yaml' | |
| - 'scripts/rust.sh' | |
| - '.github/workflows/checks.yml' | |
| commit-lint: | |
| name: Lint commits | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install package dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run commitlint | |
| uses: wagoid/commitlint-github-action@v5 | |
| lint: | |
| name: Lint code | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.src == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install package dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run Biome | |
| run: pnpm run lint | |
| - name: Run Knip | |
| run: pnpm run check:deps | |
| build-check: | |
| name: Build check | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.src == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install package dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run build check | |
| run: pnpm run build:check | |
| - name: Build artifacts | |
| run: pnpm run build | |
| - name: Verify built CLI entrypoint | |
| run: pnpm run verify:cli:build | |
| test-units-and-cover: | |
| name: Unit Tests And Coverage | |
| runs-on: ubuntu-latest | |
| needs: | |
| - changes | |
| - lint | |
| - build-check | |
| if: | | |
| needs.changes.outputs.src == 'true' && | |
| needs.lint.result == 'success' && | |
| needs.build-check.result == 'success' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install package dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run unit tests | |
| run: pnpm run test:unit | |
| - name: Run CLI test suite | |
| run: pnpm run test:cli | |
| - name: Run coverage for unit tests | |
| run: pnpm run cover:unit | |
| if: ${{ always() }} | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload coverage report for unit tests | |
| if: ${{ always() }} | |
| with: | |
| name: unit-coverage-lcov | |
| path: .coverage/unit/lcov.info | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2.3.6 | |
| if: ${{ always() }} | |
| with: | |
| path-to-lcov: ./.coverage/unit/lcov.info | |
| flag-name: Unit | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel: true | |
| test-integrations-and-cover: | |
| name: Integration Tests and Coverage | |
| runs-on: ubuntu-latest | |
| needs: | |
| - changes | |
| - lint | |
| - build-check | |
| if: | | |
| needs.changes.outputs.src == 'true' && | |
| needs.lint.result == 'success' && | |
| needs.build-check.result == 'success' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| - name: Run integration tests | |
| run: pnpm run docker:test:integration | |
| - name: Generate Cucumber report annotations | |
| uses: deblockt/cucumber-report-annotations-action@v1.7 | |
| if: ${{ always() }} | |
| continue-on-error: true | |
| with: | |
| access-token: ${{ secrets.GITHUB_TOKEN }} | |
| path: .test-reports/integration/report.json | |
| - name: Run coverage for integration tests | |
| run: pnpm run docker:cover:integration | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2.3.6 | |
| if: ${{ always() }} | |
| with: | |
| path-to-lcov: .coverage/integration/lcov.info | |
| flag-name: Integration | |
| parallel: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload coverage report for integration tests | |
| if: ${{ always() }} | |
| with: | |
| name: integration-coverage-lcov | |
| path: .coverage/integration/lcov.info | |
| post-tests: | |
| name: Post Tests | |
| runs-on: ubuntu-latest | |
| needs: | |
| - changes | |
| - test-units-and-cover | |
| - test-integrations-and-cover | |
| if: ${{ always() }} | |
| steps: | |
| - name: Coveralls Finished | |
| uses: coverallsapp/github-action@v2.3.6 | |
| if: | | |
| needs.test-units-and-cover.result != 'skipped' || | |
| needs.test-integrations-and-cover.result != 'skipped' | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| parallel-finished: true | |
| rust-checks: | |
| name: Rust Checks | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: needs.changes.outputs.rust == 'true' | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| permissions: | |
| contents: read | |
| steps: | |
| # SHA-pinned (v4.4.0) with the workflow token not persisted into the clone — the | |
| # other two Rust actions are pinned the same way; the pre-existing Node jobs keep | |
| # their own checkout lines. | |
| - name: Checkout | |
| uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 | |
| with: | |
| persist-credentials: false | |
| # rust-toolchain.toml is read automatically by the action's discovery (no toolchain-file | |
| # input exists; passing one only warns). Both actions are SHA-pinned per the house | |
| # convention the docker/* actions below already follow. | |
| - name: Install Rust toolchain | |
| uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| - name: Check formatting | |
| run: cargo fmt --all --check | |
| - name: Clippy (all targets) | |
| run: cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| - name: Clippy (strict, lib+bins) | |
| run: >- | |
| cargo clippy --workspace --lib --bins --all-features -- | |
| -D warnings -D clippy::unwrap_used -D clippy::expect_used | |
| -D clippy::todo -D clippy::unimplemented -D clippy::panic | |
| - name: Tests | |
| run: cargo test --workspace --all-features | |
| # The two database-backed storage targets create and migrate their own scratch | |
| # databases; the Cucumber half of the harness stays in scripts/storage-parity.sh. | |
| - name: Storage parity against Postgres | |
| env: | |
| PARITY_ADMIN_URL: postgres://postgres:postgres@localhost:5432/postgres | |
| run: cargo test -p nostream-storage --test migrations --test parity -- --ignored --test-threads=1 | |
| - name: Storage builds without the Postgres driver | |
| run: cargo check -p nostream-storage --no-default-features --all-targets | |
| - name: Release build | |
| run: cargo build --workspace --all-features --release | |
| changeset-check: | |
| name: Changeset Required | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' && github.head_ref != 'changeset-release/main' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install package dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Check for changeset | |
| run: pnpm exec changeset status --since origin/${{ github.base_ref }} | |
| publish-container-image: | |
| name: Build and push container image | |
| runs-on: ubuntu-latest | |
| needs: | |
| - changes | |
| - lint | |
| - build-check | |
| - test-units-and-cover | |
| - test-integrations-and-cover | |
| - post-tests | |
| if: >- | |
| always() && github.event_name == 'push' && github.ref == 'refs/heads/main' && | |
| needs.changes.result == 'success' && | |
| ( | |
| needs.changes.outputs.src != 'true' || | |
| ( | |
| needs.lint.result == 'success' && | |
| needs.build-check.result == 'success' && | |
| needs.test-units-and-cover.result == 'success' && | |
| needs.test-integrations-and-cover.result == 'success' | |
| ) | |
| ) && | |
| needs.post-tests.result == 'success' | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=main | |
| type=sha,prefix=sha- | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |