Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: deno task build
working-directory: lb

test:
check:
runs-on: ubuntu-22.04
if: github.event_name != 'push'
steps:
Expand All @@ -80,25 +80,21 @@ jobs:

- uses: Swatinem/rust-cache@v2

- name: Setup postgres for tests
run: docker compose up -d

- name: Build
run: cargo build --all-targets --tests
working-directory: api

- name: Format
run: cargo fmt --all -- --check
working-directory: api

- name: Setup postgres for tests
run: docker compose up -d

- uses: taiki-e/cache-cargo-install-action@v3
with:
tool: sqlx-cli@0.7.1

- name: Check sqlx metadata is up to date
run: |
cargo sqlx migrate run
cargo sqlx prepare --check
cargo sqlx prepare --check -- --all-targets
working-directory: api
env:
DATABASE_URL: postgres://user:password@localhost/registry
Expand All @@ -107,6 +103,27 @@ jobs:
run: cargo clippy --all-targets --all-features -- -D warnings
working-directory: api

test:
runs-on: ubuntu-22.04
if: github.event_name != 'push'
steps:
- name: Clone repository
uses: actions/checkout@v6
with:
lfs: true

- name: Install Rust
uses: dsherret/rust-toolchain-file@v1

- uses: Swatinem/rust-cache@v2

- name: Setup postgres for tests
run: docker compose up -d

- name: Build
run: cargo build --all-targets --tests
working-directory: api

- name: Test
run: cargo test
working-directory: api
Expand Down
11 changes: 9 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async-compression = { version = "0.4", features = ["futures-io", "gzip"] }
deno_graph = "=0.107.0"
deno_ast = { version = "0.53.0", features = ["view"] }
# sync with frontend/deno.json
deno_doc = { version = "=0.193.0", features = ["comrak"] }
deno_doc = { version = "=0.194.0", features = ["comrak"] }
deno_error = "0.7.0"
comrak = { version = "0.29.0", default-features = false }
ammonia = "4.0.0"
Expand Down
2 changes: 2 additions & 0 deletions api/src/analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ async fn analyze_package_inner(
let info = crate::docs::get_docs_info(&exports, None);

let ctx = crate::docs::get_generate_ctx(
"/doc".to_string(),
doc_nodes,
main_entrypoint,
info.rewrite_map,
Expand All @@ -270,6 +271,7 @@ async fn analyze_package_inner(
bun: None,
},
registry_url.to_string(),
None,
);
let search_index = deno_doc::html::generate_search_index(&ctx);
let doc_search_json = if let serde_json::Value::Object(mut obj) = search_index
Expand Down
4 changes: 4 additions & 0 deletions api/src/api/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ errors!(
status: NOT_FOUND,
"The requested package version was not found.",
},
DiffNoIndex {
status: NOT_FOUND,
"Diffs do not have an index.",
},
EntrypointOrSymbolNotFound {
status: NOT_FOUND,
"The requested entrypoint or symbol was not found.",
Expand Down
Loading
Loading