krystv commited on
Commit
7813278
·
verified ·
1 Parent(s): 2791b61

Upload .github/workflows/ci.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/ci.yml +85 -0
.github/workflows/ci.yml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: BEX Engine CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ env:
10
+ CARGO_TERM_COLOR: always
11
+
12
+ jobs:
13
+ build-and-test:
14
+ runs-on: ubuntu-22.04
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Install Rust
19
+ uses: dtolnay/rust-toolchain@stable
20
+ with:
21
+ targets: wasm32-wasip1
22
+
23
+ - name: Install wasm-tools
24
+ run: cargo install wasm-tools-cli --locked
25
+
26
+ - name: Cache cargo registry
27
+ uses: actions/cache@v4
28
+ with:
29
+ path: |
30
+ ~/.cargo/registry
31
+ ~/.cargo/git
32
+ target
33
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
34
+
35
+ - name: Build engine
36
+ run: cargo build --release
37
+
38
+ - name: Run unit tests
39
+ 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
40
+
41
+ - name: Build WASM plugins
42
+ run: |
43
+ cargo build --target wasm32-wasip1 --release \
44
+ -p bex-gogoanime -p bex-kaianime -p bex-hianime \
45
+ -p bex-imdb -p bex-kisskh -p bex-yts -p bex-yflix
46
+
47
+ - name: Pack plugins
48
+ run: bash build-plugins.sh || true
49
+
50
+ - name: E2E test
51
+ run: |
52
+ chmod +x dist/bex 2>/dev/null || true
53
+ chmod +x target/release/bex 2>/dev/null || true
54
+ BEX="./target/release/bex"
55
+ DATA_DIR="/tmp/bex-ci"
56
+ rm -rf "$DATA_DIR" && mkdir -p "$DATA_DIR"
57
+
58
+ # Install plugins
59
+ for bex in dist/*.bex; do
60
+ [ -f "$bex" ] && $BEX --data-dir "$DATA_DIR" install "$bex" && echo "Installed: $bex"
61
+ done
62
+
63
+ # List plugins
64
+ $BEX --data-dir "$DATA_DIR" list
65
+
66
+ # Stats
67
+ $BEX --data-dir "$DATA_DIR" stats
68
+
69
+ - name: Check GLIBC requirements
70
+ run: |
71
+ echo "GLIBC versions required by bex binary:"
72
+ objdump -T target/release/bex | grep GLIBC_ | sed 's/.*GLIBC_/GLIBC_/' | sort -Vu
73
+ echo ""
74
+ echo "System GLIBC:"
75
+ ldd --version | head -1
76
+
77
+ - name: Upload artifacts
78
+ uses: actions/upload-artifact@v4
79
+ with:
80
+ name: bex-linux-x64
81
+ path: |
82
+ target/release/bex
83
+ target/release/libbex_runtime.so
84
+ target/release/libbex_runtime.a
85
+ dist/*.bex