bump version -> 3.3.1-SNAPSHOT #278
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: Build and test | |
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.15.2' | |
- 'es:8.14.3' | |
- '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.3.3' | |
- 'es:8.2.3' | |
- 'es:7.17.24' | |
- 'es:7.17.8' | |
- 'es:7.14.2' | |
- 'es:7.10.2' | |
- 'os:2.17.1' | |
- 'os:2.16.0' | |
- 'os:2.15.0' | |
- '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.15.2' }} | |
sudachiVersion: 20241021 | |
sudachiKind: core | |
continue-on-error: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'temurin' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- name: Extract version and set to github env | |
run: ./gradlew -PengineVersion=${{ matrix.es-version }} printVersionForGithubActions | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
run: ./gradlew -PengineVersion=${{ matrix.es-version }} --info clean build koverXmlReport | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Prepare artifact for sonar analysis | |
if: env.mainJob == 'true' | |
run: | | |
find -iname build -type d -exec tar -cf sonar.tar {} \+ | |
echo ${{ github.event.number }} >> PR_EVENT.txt | |
echo ${{ github.event.pull_request.head.ref }} >> PR_EVENT.txt | |
echo ${{ github.event.pull_request.base.ref }} >> PR_EVENT.txt | |
- name: Upload artifact for sonar analysis | |
if: env.mainJob == 'true' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sonar-artifact | |
path: | | |
sonar.tar | |
PR_EVENT.txt | |
- name: Cache elasticsearch download | |
uses: actions/cache@v4 | |
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@v4 | |
with: | |
path: build/integration/sudachi-dictionary-${{ env.sudachiVersion }}-${{ env.sudachiKind }}.zip | |
key: sudachi-dictionary-${{ env.sudachiVersion }}-${{ env.sudachiKind }} | |
- 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: ${{ env.sudachiVersion }} | |
DIC_KIND: ${{ env.sudachiKind }} | |
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@v4 | |
name: Upload reports when failed | |
if: failure() | |
with: | |
name: failure-reports-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }} | |
path: | | |
build/reports | |
build/integration/elasticsearch-*/logs | |
- uses: actions/upload-artifact@v4 | |
name: Upload built packages | |
if: success() | |
with: | |
name: build-artifacts-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }} | |
path: | | |
build/distributions/*.zip | |
- uses: actions/upload-artifact@v4 | |
name: Upload SPI jar | |
if: env.mainJob == 'true' | |
with: | |
name: build-artifacts-spi-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }} | |
path: | | |
spi/build/libs/sudachi-*.jar | |
- name: 'Publish SPI jar to maven central' | |
if: env.mainJob == 'true' && success() && startsWith(github.ref, 'refs/heads/develop') | |
run: ./gradlew -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 }} |