-
Notifications
You must be signed in to change notification settings - Fork 657
156 lines (152 loc) · 5.3 KB
/
continuous.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Continuous
on:
pull_request:
paths-ignore:
- "**.md"
- "**.ipynb"
- "**.json"
- "**.html"
- "**.js"
- "**.css"
- "android/**"
push:
paths-ignore:
- "**.md"
- "**.ipynb"
- "**.json"
- "**.html"
- "**.js"
- "**.css"
- "android/**"
jobs:
build:
if: github.repository == 'deepjavalibrary/djl'
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ ubuntu-latest, macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
# Enable gradle cache: https://github.com/actions/cache/blob/master/examples.md#java---gradle
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle.kts', 'engines/**/build.gradle.kts', 'extensions/**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: check disk space
run: df -h
- uses: dorny/paths-filter@v2
id: sentencepiece_changes
with:
filters: |
src:
- 'extensions/sentencepiece/**'
- name: install libomp on macos
if: ${{ runner.os == 'macOS' }}
run: brew install libomp
- name: Compile Sentencepiece JNI
if: steps.sentencepiece_changes.outputs.src == 'true'
run: ./gradlew :extensions:sentencepiece:compileJNI
- uses: dorny/paths-filter@v2
id: fasttext_changes
with:
filters: |
src:
- 'extensions/fasttext/**'
- name: Compile fastText JNI
if: steps.fasttext_changes.outputs.src == 'true'
run: ./gradlew :extensions:fasttext:compileJNI
- uses: dorny/paths-filter@v2
id: tokenizers_changes
with:
filters: |
src:
- 'extensions/tokenizers/**'
- name: Compile tokenizers JNI
if: steps.tokenizers_changes.outputs.src == 'true'
run: ./gradlew :extensions:tokenizers:compileJNI
- uses: dorny/paths-filter@v2
id: pytorch_changes
with:
filters: |
src:
- 'engines/pytorch/pytorch-native/**'
- name: Compile PyTorch JNI
if: steps.pytorch_changes.outputs.src == 'true'
run: ./gradlew :engines:pytorch:pytorch-native:compileJNI
- name: Test ONNX Runtime
run: |
./gradlew -Dai.djl.default_engine=OnnxRuntime :integration:clean :integration:test
- name: Build with Gradle
run: ./gradlew build :jacoco:testCodeCoverageReport
- name: Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: reports-${{ matrix.operating-system }}
path: |
${{ github.workspace }}/**/build/reports/**/*
!${{ github.workspace }}/**/build/reports/jacoco/*
- name: upload to codecov
uses: codecov/codecov-action@v3
with:
files: ./jacoco/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
fail_ci_if_error: false
path_to_write_report: ./codecov_report.txt
# Windows platform for testing hybrid engines
build-windows:
if: github.repository == 'deepjavalibrary/djl'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 17
# Enable gradle cache: https://github.com/actions/cache/blob/master/examples.md#java---gradle
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('*/build.gradle.kts', 'engines/**/build.gradle.kts', 'extensions/**/build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: dorny/paths-filter@v2
id: sentencepiece_changes
with:
filters: |
src:
- 'extensions/sentencepiece/**'
- name: Compile Sentencepiece JNI
if: steps.sentencepiece_changes.outputs.src == 'true'
run: ./gradlew :extensions:sentencepiece:compileJNI
- uses: dorny/paths-filter@v2
id: pytorch_changes
with:
filters: |
src:
- 'engines/pytorch/pytorch-native/**'
- name: Compile PyTorch JNI
if: steps.pytorch_changes.outputs.src == 'true'
run: ./gradlew :engines:pytorch:pytorch-native:compileJNI
- uses: dorny/paths-filter@v2
id: tokenizers_changes
with:
filters: |
src:
- 'extensions/tokenizers/**'
- name: Compile tokenizers JNI
if: steps.tokenizers_changes.outputs.src == 'true'
run: ./gradlew :extensions:tokenizers:compileJNI
- name: Integration tests
# MXNet integration test on Github Action fail due to memory limitation on Windows
run: |
./gradlew -Pjni "-Dai.djl.default_engine=PyTorch" test -x examples:test
./gradlew -Pjni --rerun-tasks "-Dai.djl.default_engine=TensorFlow" test -x examples:test
./gradlew --rerun-tasks "-Dai.djl.default_engine=OnnxRuntime" :integration:test