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
39 changes: 37 additions & 2 deletions .github/workflows/theseus-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ on:
schedule:
- cron: "0 0 1 * *"
workflow_dispatch:
inputs:
reprocess:
description: 'Reprocess state. Type "all" to wipe and rebuild completely, or "last" to re-calculate the most recent period.'
required: false
type: choice
options:
- ""
- "last"
- "all"
default: ""
full_fossil_scan:
description: 'Run a full deep-scan for fossils (uncheck to only do a fast survivor update)'
required: false
type: boolean
default: false

concurrency:
group: theseus-data-engine
Expand Down Expand Up @@ -43,12 +58,30 @@ jobs:
- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Rust Cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
with:
workspaces: "engine -> target"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Build engine
working-directory: engine
run: cargo build --release

- name: Run pipeline for ${{ matrix.repo }}
id: pipeline
continue-on-error: true
env:
REPO_NAME: ${{ matrix.repo }}
run: poetry run python -m scripts.run_pipeline --repo "$REPO_NAME" --update-survivor
REPROCESS_INPUT: ${{ inputs.reprocess }}
run: |
ARGS=()
if [ -n "$REPROCESS_INPUT" ]; then
ARGS+=(--reprocess "$REPROCESS_INPUT")
fi
if [ "${{ inputs.full_fossil_scan }}" != "true" ]; then
ARGS+=(--update-survivor)
fi
poetry run python -m scripts.run_pipeline --repo "$REPO_NAME" "${ARGS[@]}"
timeout-minutes: 120

- name: Save status
Expand All @@ -64,7 +97,9 @@ jobs:
with:
name: data-${{ matrix.repo }}
path: |
data/raw/${{ matrix.repo }}_data.json
data/raw/${{ matrix.repo }}_history.jsonl
data/raw/${{ matrix.repo }}_fossils.json
data/state/${{ matrix.repo }}_state.json
data/processed/${{ matrix.repo }}_graph.json
data/.status/${{ matrix.repo }}.json
retention-days: 1
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,25 @@ jobs:
- name: Install dependencies
run: poetry install --with dev

- name: Run linter
- name: Run Python linter
run: poetry run pylint scripts/ --output-format=colorized
continue-on-error: true

- name: Run tests
- name: Run Python tests
run: poetry run pytest tests/ -v --tb=short

- name: Rust Cache
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32
with:
workspaces: "engine -> target"

- name: Run Rust Lints & Formatting
working-directory: engine
run: |
cargo fmt --check
cargo clippy -- -D warnings
continue-on-error: true

- name: Run Rust tests
working-directory: engine
run: cargo test
19 changes: 19 additions & 0 deletions build_engine.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@echo off
set CARGO_CMD=cargo
where cargo >nul 2>nul
if %errorlevel% neq 0 (
set CARGO_CMD="%USERPROFILE%\.cargo\bin\cargo.exe"
)

echo Building Theseus Engine (Release mode)...
pushd "%~dp0engine" || exit /b 1
%CARGO_CMD% build --release
set "EXIT_CODE=%errorlevel%"
popd
if %EXIT_CODE% neq 0 (
echo Build failed! Make sure Rust is installed and in your PATH.
pause
exit /b %EXIT_CODE%
)
echo Build successful! The binary is located at engine\target\release\engine.exe
pause
Loading