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
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,50 @@ env:
RUSTFLAGS: -D warnings

jobs:
# Build the Svelte UI once; every Rust job below downloads these assets so
# `rust-embed` embeds the real web UI (parity with the release build).
web:
name: web (svelte assets)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install + check + build
run: |
npm --prefix web ci --no-audit --no-fund
npm --prefix web run check
npm --prefix web run build
- name: Upload built assets (for embedding)
uses: actions/upload-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
if-no-files-found: error

clippy:
name: clippy
needs: web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- run: cargo clippy --workspace --all-targets -- -D warnings
- run: cargo clippy -p codegraph-graph --features postgres,mysql,redis --tests -- -D warnings

clippy-windows:
name: clippy (windows)
needs: web
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -36,17 +66,26 @@ jobs:
components: clippy
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- run: cargo clippy -p codegraph --target x86_64-pc-windows-msvc -- -D warnings

test-windows:
name: test (windows)
needs: web
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- name: Build
run: cargo build -p codegraph
- name: Build (fastembed feature)
Expand All @@ -62,6 +101,7 @@ jobs:

test:
name: test (${{ matrix.os }})
needs: web
runs-on: ${{ matrix.os }}
services:
redis:
Expand Down Expand Up @@ -93,6 +133,10 @@ jobs:
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- name: Install DB clients
run: sudo apt-get update && sudo apt-get install -y postgresql-client mysql-client
- name: Install radare2 (binary analysis integration tests)
Expand Down Expand Up @@ -148,13 +192,18 @@ jobs:

slim:
name: slim build (no visualize)
needs: web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- run: cargo clippy -p codegraph --no-default-features -- -D warnings
- run: cargo build -p codegraph --no-default-features
- run: |
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,33 @@ permissions:
contents: write

jobs:
# Build the Svelte UI once; deb/rpm build from source and rust-embed needs the
# built assets present (see crates/codegraph-web).
web:
name: web (svelte assets)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- name: Build web assets
run: |
npm --prefix web ci --no-audit --no-fund
npm --prefix web run build
- name: Upload web assets
uses: actions/upload-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
if-no-files-found: error

# Build .deb packages for Debian/Ubuntu (and derivatives) from the gnu targets.
deb:
name: deb (${{ matrix.target }})
needs: web
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -33,6 +57,10 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- name: Install cross linker (aarch64)
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: |
Expand All @@ -52,6 +80,7 @@ jobs:
# Build .rpm packages for Fedora/RHEL (and derivatives) from the gnu targets.
rpm:
name: rpm (${{ matrix.target }})
needs: web
runs-on: ubuntu-22.04
strategy:
fail-fast: false
Expand All @@ -67,6 +96,10 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: actions/download-artifact@v4
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- name: Install rpm tooling + cross linker (aarch64)
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: |
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,39 @@ jobs:
name: artifacts-plan-dist-manifest
path: plan-dist-manifest.json

# Build the web UI once (platform-independent) → artifact consumed by the
# per-target build jobs so rust-embed can include it in every binary.
build-web:
name: build-web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: web/package-lock.json
- name: Build web assets
run: |
npm --prefix web ci --no-audit --no-fund
npm --prefix web run check
npm --prefix web run build
- name: Upload web assets
uses: actions/upload-artifact@v7
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
if-no-files-found: error

# Build and packages all the platform-specific things
build-local-artifacts:
name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
# Let the initial task tell us to not run (currently very blunt)
needs:
- plan
- build-web
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -136,6 +163,11 @@ jobs:
pattern: artifacts-*
path: target/distrib/
merge-multiple: true
- name: Fetch web assets (for rust-embed)
uses: actions/download-artifact@v8
with:
name: codegraph-web-assets
path: crates/codegraph-web/assets/
- name: Install dependencies
run: |
${{ matrix.packages_install }}
Expand Down
Loading
Loading