-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (75 loc) · 2.13 KB
/
test-darwin-java.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
name: Java Binding on macOS
on:
pull_request:
paths:
- ".github/workflows/test-darwin-java.yml"
- "mecab/**"
push:
branches:
- main
paths:
- ".github/workflows/test-darwin-java.yml"
- "mecab/**"
jobs:
tets:
name: Test
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
distribution:
- temurin
- zulu
java:
- "8"
- "11"
- "17"
- "21"
steps:
- uses: actions/checkout@v4
- name: setup
run: .github/setup-darwin.sh
- name: restore cache
id: cache
uses: actions/cache@v4
with:
path: |
~/local
key: v1-mecab-${{ runner.os }}-${{ hashFiles('mecab/src/*.cpp', 'mecab/src/*.h') }}
- name: configure PATH
run: |
echo "$HOME/local/bin" >> "$GITHUB_PATH"
- name: install mecab
if: steps.cache.outputs.cache-hit != 'true'
run: |
./autogen.sh
./configure --enable-utf8-only --prefix "$HOME/local"
make -j2
make install
working-directory: mecab
- name: install ipadic utf-8
if: steps.cache.outputs.cache-hit != 'true'
run: |
./autogen.sh --prefix "$HOME/local"
./configure --with-charset=utf8
make
make install
working-directory: mecab-ipadic
- name: setup java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.java }}
- name: configure C/C++
run: |
echo "LD_LIBRARY_PATH=$HOME/local/lib:$JAVA_HOME/lib:$PWD/mecab/java" >> "$GITHUB_ENV"
echo "LIBRARY_PATH=$HOME/local/lib:$JAVA_HOME/lib" >> "$GITHUB_ENV"
echo "CPATH=$HOME/local/include:$JAVA_HOME/include:$JAVA_HOME/include/darwin" >> "$GITHUB_ENV"
- run: java -version
- name: build and test
run: |
./autogen.sh
./configure
make
# java -classpath .:MeCab.jar test # TODO: FIX ME
working-directory: mecab/java