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
3 changes: 2 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
common --enable_bzlmod
test --test_output=errors
test --test_env=HOME
test --test_env=USER
build --action_env=CC
build --action_env=PATH

# Release profile
build:release -c opt
build:release --@rules_rust//:extra_rustc_flags=-Cstrip=symbols,-Cpanic=abort,-Ccodegen-units=1,-Copt-level=z
40 changes: 28 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,26 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cargo fmt
run: nix develop --command cargo fmt --all -- --check
run: cargo fmt --all -- --check

- name: Clippy
run: nix develop --command cargo clippy --workspace -- -D warnings
run: cargo clippy --workspace -- -D warnings

- name: Tests
run: nix develop --command cargo test --workspace
run: cargo test --workspace

build-bindings:
name: Build Bindings
Expand All @@ -36,20 +45,27 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: dtolnay/rust-toolchain@stable

- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build core
run: nix develop --command cargo build -p stdbr-core
run: cargo build -p stdbr-core

- name: Build ffi-c
run: nix develop --command cargo build -p stdbr-ffi
run: cargo build -p stdbr-ffi

- name: Build nodejs
run: nix develop --command cargo build -p stdbr-napi
run: cargo build -p stdbr-napi

- name: Build python
run: nix develop --command cargo build -p stdbr-python
run: cargo build -p stdbr-python

- name: Build wasm
run: nix develop --command cargo build -p stdbr-wasm --target wasm32-unknown-unknown
run: cargo build -p stdbr-wasm --target wasm32-unknown-unknown
16 changes: 6 additions & 10 deletions .github/workflows/ibge-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@stable

- name: Cache cargo
uses: actions/cache@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-ibge-${{ hashFiles('**/Cargo.lock') }}

- name: Fetch latest IBGE data
run: |
curl -sf -o core/tests/data/ibge_municipios_$(date +%Y-%m-%d).json \
"https://servicodados.ibge.gov.br/api/v1/localidades/municipios?orderBy=nome"
- name: Generate golden.json (fetches IBGE data from API)
run: cargo run -p parity-gen > tests/parity/golden.json

- name: Run IBGE sync tests
run: cargo test -p stdbr-core --test municipio_ibge_sync
- name: Run parity tests (includes IBGE sync validation)
run: cargo test -p stdbr-core --test parity

- name: Open issue if out of sync
if: failure()
Expand Down
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
.direnv

/bazel-*

/target

node_modules/
*.node
bindings/nodejs/index.d.ts

__pycache__/
*.egg-info/
dist/
*.so

*.dylib

core/tests/data/
tests/parity/golden.json

.claude/
.vscode/
Loading
Loading