자잘한 버그 수정 #327
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |