-
-
Notifications
You must be signed in to change notification settings - Fork 50
90 lines (86 loc) · 3.65 KB
/
macos.yml
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
88
89
90
name: macOS
on:
pull_request:
branches: [ main ]
jobs:
build-macos:
strategy:
matrix:
include:
- name: "macOS 13 + Xcode 15.0"
os: macos-13
arch: x86_64
compiler: xcode
version: "15.0"
- name: "macOS 14 Arm64 + Xcode 15.0"
os: macos-14
arch: arm64
compiler: xcode
version: "15.0"
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
lfs: true
- name: Configure Compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
ls -ls /Applications/
sudo xcode-select -switch /Applications/Xcode_${{ matrix.version }}.app
echo "CC=$(brew --prefix llvm@15)/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix llvm@15)/bin/clang++" >> $GITHUB_ENV
fi
- name: Configure Build
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_JAVA_BINDING=1 ..
- name: Build
run: cd build && make -j2
- name: Run Unit Test
run: ./build/test/kiwi-test
- name: Run Unit Test in Debug mode
if: failure()
run: |
mkdir build_debug && cd build_debug && cmake -DCMAKE_BUILD_TYPE=Debug .. && make -j2
cd .. && lldb -o run -o bt ./build_debug/test/kiwi-test
- name: Run Java Unit Test
run: |
cd bindings/java
curl -OL https://repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar
curl -OL https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
javac -cp "*:../../build/bindings/java/*:." -encoding utf-8 kr/pe/bab2min/KiwiTest.java
java -cp "*:../../build/bindings/java/*:." org.junit.runner.JUnitCore kr.pe.bab2min.KiwiTest
- name: Run Evaluator
run: |
mkdir eval_results
./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
- name: Run Benchmark
run: |
curl -OL https://latina.bab2min.pe.kr/_data/kowiki1000.txt
./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
if [ "${{ matrix.arch }}" = "x86_64" ]; then
KIWI_ARCH_TYPE=sse2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse4_1 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out --typos 6 kowiki1000.txt
else
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out --typos 6 kowiki1000.txt
fi
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
name: Artifacts ${{ matrix.name }}
path: |
build/*kiwi*
build/test/*kiwi*
eval_results/*.txt
build/bindings/java/*.jar