Skip to content

feat(ta+discovery): moving averages exist in the rule vocabulary, and… #841

feat(ta+discovery): moving averages exist in the rule vocabulary, and…

feat(ta+discovery): moving averages exist in the rule vocabulary, and… #841

Workflow file for this run

# Firebat CI — Rust 변경 시만 trigger.
#
# Frontend-only 변경 (app/ lib/ language/ next.config.mjs 등) 시 cargo build/test 생략.
# 매 push 마다 ~10분 release build 박이 실행되던 부담 제거.
#
# Trigger:
# - core / infra / proto / Cargo.* 변경 시만 rust + release-binary 실행
# - .github/workflows/ci-rust.yml 자체 변경 시도 trigger (workflow 자체 검증)
name: CI Rust
on:
push:
branches: [main]
paths:
- 'core/**'
- 'infra/**'
- 'proto/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-rust.yml'
pull_request:
branches: [main]
paths:
- 'core/**'
- 'infra/**'
- 'proto/**'
- 'Cargo.toml'
- 'Cargo.lock'
- '.github/workflows/ci-rust.yml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
# rust-lld(Rust 1.96 기본 링커)가 candle+gemm 정적 링크된 거대한 테스트 바이너리들을 lld 내부
# 멀티스레드(parallelFor)로 동시 링크하다 러너 메모리 고갈 → SIGBUS(core dumped). lld 단일 스레드로
# 강제해 parallelFor 크래시 경로를 회피하고 링크 피크 메모리를 낮춘다.
RUSTFLAGS: "-Clink-arg=-Wl,--threads=1"
# 동시 컴파일/링크 잡 4→2 — 동시에 링크되는 거대 바이너리 수를 줄여 피크 메모리 추가 절감.
CARGO_BUILD_JOBS: "2"
# 테스트 바이너리 debug info 제거 — candle/image/pdf/tokenizers 등 무거운 deps 가 매 테스트 바이너리에
# 정적 링크되며 debug 심볼까지 붙어 target/debug 가 러너 디스크(~14GB)를 초과(os error 28). debug=0 으로
# 바이너리 크기를 대폭 줄여 디스크 + 링크 피크 메모리(위 SIGBUS 영역)를 함께 낮춘다. (테스트 통과/실패엔 무영향)
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
jobs:
rust:
name: Rust (cargo test)
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Free disk space (remove preinstalled SDKs)
# 러너 기본 디스크(~14GB free)가 거대 deps 테스트 바이너리로 부족(os error 28). 안 쓰는
# 사전설치 SDK(dotnet/android/ghc/CodeQL) 제거로 ~20GB+ 확보.
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/local/lib/android /opt/hostedtoolcache/CodeQL
df -h /
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: firebat-rust
cache-on-failure: true
- name: cargo check
run: cargo check -p firebat-core -p firebat-infra --all-targets
- name: cargo test (infra)
run: cargo test -p firebat-infra --tests
release-binary:
name: Release binary
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.ref == 'refs/heads/main'
needs: [rust]
steps:
- uses: actions/checkout@v4
- name: Free disk space (remove preinstalled SDKs)
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/local/lib/android /opt/hostedtoolcache/CodeQL
df -h /
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: firebat-release
cache-on-failure: true
- name: cargo build --release
run: cargo build --release -p firebat-infra --bin firebat-core
- name: Stage artifact (binary only)
# artifact = Rust binary 만. system/ (LLM registry + prompts + sysmod) 은 git pull 흐름
# (`/opt/firebat-src/system` symlink → `/opt/firebat/system`) 으로 운영 서버에 도달 — artifact
# 영역에 같이 박으면 중복.
run: |
mkdir -p artifact
cp target/release/firebat-core artifact/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: firebat-core-linux-x86_64
# zip 안 내용 = firebat-core 단일 파일. unzip 즉시 FTP 업로드 가능.
# system/ 영역은 `/opt/firebat-src` 에서 git pull 로 갱신.
path: artifact/**
retention-days: 30