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
31 changes: 10 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,46 +103,35 @@ jobs:
run: |
mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/001-initial-schema.sql
mysql -h 127.0.0.1 -P 3306 -u root -ppostgres codegraph < sql/mysql/002-add-repos-registry.sql
- name: Install grcov
uses: taiki-e/install-action@grcov
- name: Run tests with coverage instrumentation
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Clean coverage data
run: cargo llvm-cov clean --workspace
- name: Run tests with coverage
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "codegraph-%p-%m.profraw"
run: cargo test --workspace --no-fail-fast
run: cargo llvm-cov test --workspace --no-fail-fast --no-report
- name: Storage integration tests (postgres)
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "codegraph-%p-%m.profraw"
TEST_RDBMS_DSN: "postgres://postgres:postgres@127.0.0.1:5432/codegraph"
TEST_RDBMS_REPO_ID: "1"
run: cargo test -p codegraph-graph --features postgres --test rdbms -- --ignored --nocapture --test-threads=1
run: cargo llvm-cov test -p codegraph-graph --features postgres --test rdbms --no-report -- --ignored --nocapture --test-threads=1
- name: Storage integration tests (mysql)
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "codegraph-%p-%m.profraw"
TEST_RDBMS_DSN: "mysql://root:postgres@127.0.0.1:3306/codegraph"
TEST_RDBMS_REPO_ID: "1"
run: cargo test -p codegraph-graph --features mysql --test rdbms -- --ignored --nocapture --test-threads=1
run: cargo llvm-cov test -p codegraph-graph --features mysql --test rdbms --no-report -- --ignored --nocapture --test-threads=1
- name: Storage integration tests (redis)
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "codegraph-%p-%m.profraw"
TEST_REDIS_DSN: "redis://127.0.0.1:6379"
run: cargo test -p codegraph-graph --features redis --test redis -- --ignored --nocapture
run: cargo llvm-cov test -p codegraph-graph --features redis --test redis --no-report -- --ignored --nocapture
- name: Generate coverage report (lcov)
run: |
mkdir -p ./target/coverage
grcov . \
--binary-path ./target/debug/ \
--source-dir . \
--output-type lcov \
--branch \
--ignore-not-existing \
--ignore "/*" \
--ignore "*/tests/*" \
--ignore "*/benches/*" \
--output-path ./target/coverage/lcov.info
cargo llvm-cov report --lcov --output-path ./target/coverage/lcov.info

- name: Upload to Codecov
uses: codecov/codecov-action@v5
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/release-sign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ name: Sign & Verify Release
on:
release:
types: [published]
# Allow manually signing an already-published release (e.g. v2.0.1) from the
# Actions tab — useful for backfilling signatures without a new release.
workflow_dispatch:
inputs:
tag:
description: "Release tag to sign (e.g. v2.0.1)"
required: true
default: ""

permissions:
contents: write # upload release assets (.sig / .crt / re-packed tarball)
Expand All @@ -33,7 +41,7 @@ jobs:
- name: Poll until macOS tarballs exist
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
TAG: ${{ github.event.release.tag_name || github.event.inputs.tag }}
run: |
set -euo pipefail
for i in $(seq 1 60); do
Expand All @@ -56,7 +64,7 @@ jobs:
- name: Re-codesign + re-upload macOS tarballs
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
TAG: ${{ github.event.release.tag_name || github.event.inputs.tag }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
Expand Down Expand Up @@ -86,7 +94,7 @@ jobs:
- name: Sign every binary archive
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.event.release.tag_name }}
TAG: ${{ github.event.release.tag_name || github.event.inputs.tag }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
Expand Down
22 changes: 11 additions & 11 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ members = [
]

[workspace.package]
version = "2.0.2"
version = "2.0.3"
edition = "2021"
rust-version = "1.80"
license = "MIT"
Expand Down
10 changes: 10 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
project:
default:
target: 70% # Tổng coverage toàn dự án phải đạt tối thiểu 70%
threshold: 10% # Cho phép sai lệch tối đa 10 điểm % (PR vẫn pass nếu coverage >= 60%)
patch:
default:
target: 100% # Các dòng code mới trong PR phải được test phủ 100%
threshold: 0% # Không chấp nhận bất kỳ dòng code mới nào thiếu test
2 changes: 1 addition & 1 deletion packaging/aur/codegraph-rs-bin/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Maintainer: Hung Pham <hung0913208@icloud.com>
pkgname=codegraph-rs-bin
pkgver=2.0.2
pkgver=2.0.3
pkgrel=1
pkgdesc="Local-first code intelligence: tree-sitter knowledge graph + MCP server (prebuilt binary)"
arch=('x86_64' 'aarch64')
Expand Down
2 changes: 1 addition & 1 deletion packaging/choco/codegraph.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>codegraph</id>
<version>2.0.2</version>
<version>2.0.3</version>
<title>codegraph</title>
<authors>Hung Pham</authors>
<projectUrl>https://github.com/hungpham10/codegraph-rs</projectUrl>
Expand Down
4 changes: 2 additions & 2 deletions packaging/winget/codegraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# release time (or automate it in the release pipeline before submitting to
# microsoft/winget-pkgs).
PackageIdentifier: hungpham10.codegraph
PackageVersion: 2.0.2
PackageVersion: 2.0.3
PackageName: codegraph
Publisher: Hung Pham
PublisherUrl: https://github.com/hungpham10/codegraph-rs
Expand All @@ -18,7 +18,7 @@ PackageUrl: https://github.com/hungpham10/codegraph-rs
InstallerType: zip
Installers:
- Architecture: x64
InstallerUrl: https://github.com/hungpham10/codegraph-rs/releases/download/v2.0.2/codegraph-x86_64-pc-windows-msvc.zip
InstallerUrl: https://github.com/hungpham10/codegraph-rs/releases/download/v2.0.3/codegraph-x86_64-pc-windows-msvc.zip
InstallerSha256: 0000000000000000000000000000000000000000000000000000000000000000
InstallerType: zip
ManifestType: singleton
Expand Down
4 changes: 2 additions & 2 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#
# Usage (pin a version / download the script first):
# irm https://raw.githubusercontent.com/hungpham10/codegraph-rs/main/scripts/install.ps1 -OutFile install.ps1
# .\install.ps1 -Version 2.0.2
# .\install.ps1 -Version 2.0.3

[CmdletBinding()]
param(
# Pin a specific version, e.g. "2.0.2". Empty = latest release.
# Pin a specific version, e.g. "2.0.3". Empty = latest release.
[string]$Version
)

Expand Down
Loading