krystv's picture
Upload .github/workflows/ci.yml
7813278 verified
name: BEX Engine CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
build-and-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-wasip1
- name: Install wasm-tools
run: cargo install wasm-tools-cli --locked
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build engine
run: cargo build --release
- name: Run unit tests
run: cargo test --workspace --exclude bex-gogoanime --exclude bex-kaianime --exclude bex-hianime --exclude bex-imdb --exclude bex-kisskh --exclude bex-yts --exclude bex-yflix
- name: Build WASM plugins
run: |
cargo build --target wasm32-wasip1 --release \
-p bex-gogoanime -p bex-kaianime -p bex-hianime \
-p bex-imdb -p bex-kisskh -p bex-yts -p bex-yflix
- name: Pack plugins
run: bash build-plugins.sh || true
- name: E2E test
run: |
chmod +x dist/bex 2>/dev/null || true
chmod +x target/release/bex 2>/dev/null || true
BEX="./target/release/bex"
DATA_DIR="/tmp/bex-ci"
rm -rf "$DATA_DIR" && mkdir -p "$DATA_DIR"
# Install plugins
for bex in dist/*.bex; do
[ -f "$bex" ] && $BEX --data-dir "$DATA_DIR" install "$bex" && echo "Installed: $bex"
done
# List plugins
$BEX --data-dir "$DATA_DIR" list
# Stats
$BEX --data-dir "$DATA_DIR" stats
- name: Check GLIBC requirements
run: |
echo "GLIBC versions required by bex binary:"
objdump -T target/release/bex | grep GLIBC_ | sed 's/.*GLIBC_/GLIBC_/' | sort -Vu
echo ""
echo "System GLIBC:"
ldd --version | head -1
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bex-linux-x64
path: |
target/release/bex
target/release/libbex_runtime.so
target/release/libbex_runtime.a
dist/*.bex