Repository navigation
87 lines (82 loc) · 2.72 KB
/
Copy pathsdk.yml
File metadata and controls
87 lines (82 loc) · 2.72 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: sdk
on:
push:
pull_request:
jobs:
python-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install fonts and test dependencies
run: |
sudo apt-get update
sudo apt-get install -y fonts-dejavu-core
python -m pip install -U pip
python -m pip install pytest pillow numpy onnxruntime onnx opencv-python-headless
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
- name: Unit tests
run: python -m pytest -q python/tests training/tests
cpp:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux-x64
- os: ubuntu-24.04-arm
target: linux-aarch64
- os: windows-latest
target: win-x64
- os: macos-latest
target: osx-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Fetch ONNX Runtime
shell: bash
run: bash cpp/scripts/fetch_ort.sh "${{ runner.temp }}/ort" 1.22.0 ${{ matrix.target }}
- name: Configure and build
shell: bash
run: |
cmake -S cpp -B cpp/build -DORT_ROOT="${{ runner.temp }}/ort" -DCMAKE_BUILD_TYPE=Release
cmake --build cpp/build --parallel
- name: Geometry test
shell: bash
run: |
bin="$(find cpp/build -type f \( -name rapidstamp_test_geom -o -name rapidstamp_test_geom.exe \) | head -n 1)"
test -n "${bin}"
"${bin}" cpp/testdata/unwrap_golden.txt
android-arm64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install NDK
run: |
sudo apt-get update
sudo apt-get install -y unzip wget
wget -q https://dl.google.com/android/repository/android-ndk-r26d-linux.zip -O /tmp/ndk.zip
sudo unzip -q /tmp/ndk.zip -d /opt
echo "ANDROID_NDK_HOME=/opt/android-ndk-r26d" >> "$GITHUB_ENV"
- name: Build Android library
run: bash cpp/scripts/build_android.sh
wheels:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Build and install the wheel
shell: bash
run: |
python -m pip install -U pip build
python -m build python
python -m pip install python/dist/rapidstamp-0.1.0-py3-none-any.whl
python -c "import rapidstamp; print(rapidstamp.__version__)"