-
-
Notifications
You must be signed in to change notification settings - Fork 42
150 lines (148 loc) · 4.96 KB
/
build.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
name: build
on:
push:
branches: [ develop ]
pull_request:
types: [opened, synchronize, reopened]
branches: [ develop ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
es-version:
- 'es:8.13.4'
- 'es:8.12.2'
- 'es:8.11.4'
- 'es:8.10.4'
- 'es:8.9.2'
- 'es:8.8.2'
- 'es:8.7.1'
- 'es:8.6.2'
- 'es:8.5.3'
- 'es:8.4.3'
- 'es:8.2.3'
- 'es:7.17.21'
- 'es:7.14.2'
- 'es:7.10.2'
- 'os:2.14.0'
- 'os:2.13.0'
- 'os:2.12.0'
- 'os:2.11.1'
- 'os:2.10.0'
- 'os:2.9.0'
- 'os:2.8.0'
- 'os:2.7.0'
- 'os:2.6.0'
env:
mainJob: ${{ matrix.es-version == 'es:8.13.4' }}
githubRef: ${{ github.ref }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
- name: Cache SonarCloud packages
if: env.mainJob == 'true'
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar-${{ hashFiles('build.gradle') }}
- name: Extract version
uses: eskatos/gradle-command-action@v2
with:
arguments: -PengineVersion=${{ matrix.es-version }} printVersionForGithubActions
cache-read-only: false # ${{ github.ref != 'refs/heads/develop' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build # This stage sets up gradle caching
uses: eskatos/gradle-command-action@v2
with:
arguments: -PengineVersion=${{ matrix.es-version }} --info clean build koverXmlReport
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Analyze with sonarqube
if: env.mainJob == 'true'
uses: eskatos/gradle-command-action@v2
with:
arguments: -PengineVersion=${{ matrix.es-version }} --info sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Cache elasticsearch download
uses: actions/cache@v3
with:
path: build/integration/${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }}-linux-x86_64.tar.gz
key: ${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }}
- name: Cache dictionary download
uses: actions/cache@v3
with:
path: build/integration/sudachi-dictionary-20230110-small.zip
key: sudachi-dictionary-20230110
- name: Integration test
env:
ES_KIND: ${{ env.ENGINE_KIND }}
ES_VERSION: ${{ env.ENGINE_VERSION }}
PLUGIN_VERSION: ${{ env.PROJ_VERSION }}
RUN_ES_DAEMON: 1
DIC_VERSION: 20230110
run: |
bash test-scripts/00-install-elasticsearch.sh
sleep 30
python3 test-scripts/01-integration-test.py
bash test-scripts/10-make-index.sh
python3 test-scripts/20-put-docs.py
python3 test-scripts/30-test-docs.py
bash test-scripts/80-delete-index.sh
bash test-scripts/10-make-index.sh
python3 test-scripts/20-put-docs.py
python3 test-scripts/30-test-docs.py
bash test-scripts/80-delete-index.sh
bash test-scripts/10-make-index.sh
python3 test-scripts/20-put-docs.py
python3 test-scripts/30-test-docs.py
bash test-scripts/80-delete-index.sh
bash test-scripts/10-make-index.sh
python3 test-scripts/20-put-docs.py
python3 test-scripts/30-test-docs.py
bash test-scripts/80-delete-index.sh
- uses: actions/upload-artifact@v3
name: Upload reports when failed
if: failure()
with:
name: failure-reports
path: |
build/reports
build/integration/elasticsearch-*/logs
- uses: actions/upload-artifact@v3
name: Upload built packages
if: success()
with:
name: build-artifacts
path: |
build/distributions/*.zip
- uses: actions/upload-artifact@v3
name: Upload SPI jar
if: env.mainJob == 'true'
with:
name: build-artifacts
path: |
spi/build/libs/sudachi-*.jar
- name: 'Publish SPI jar to maven central'
uses: eskatos/gradle-command-action@v2
if: env.mainJob == 'true' && success() && startsWith(github.ref, 'refs/heads/develop')
with:
arguments: -PengineVersion=${{ matrix.es-version }} --info publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_USERNAME: GITHUB_ACTOR
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_USER_PASSWORD: ${{ secrets.MAVEN_USER_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
MAVEN_GPG_PRIVATE_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}