-
Notifications
You must be signed in to change notification settings - Fork 273
59 lines (48 loc) · 1.4 KB
/
test.yml
File metadata and controls
59 lines (48 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: test
on:
pull_request:
branches:
- master
push:
branches:
- master
# Cancel a currently running workflow from the same PR/branch/tag
# when a new workflow is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
js-test:
name: JS Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Run Tests
run: bun test src/__tests__
cpp-test:
name: C++ Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Install build dependencies
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev libbz2-dev
- name: Build HDiffPatch library
working-directory: android/jni/HDiffPatch
run: make LZMA=0 DIR_DIFF=0
- name: Build and run unit_test
working-directory: android/jni/HDiffPatch
run: |
g++ -O2 test/unit_test.cpp libhdiffpatch.a \
-D_IS_NEED_ALL_CompressPlugin=0 \
-D_IS_NEED_DEFAULT_CompressPlugin=0 \
-D_IS_NEED_DIR_DIFF_PATCH=0 \
-lpthread \
-o unit_test
./unit_test