Skip to content

Commit

Permalink
Merge pull request #130 from WorksApplications/feature/update-github-…
Browse files Browse the repository at this point in the history
…actions

Update github actions
  • Loading branch information
mh-northlander authored May 31, 2024
2 parents 87c5271 + 90e541a commit a336eef
Showing 1 changed file with 20 additions and 28 deletions.
48 changes: 20 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,51 +39,45 @@ jobs:
- '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
- uses: actions/checkout@v4
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
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Cache SonarCloud packages
if: env.mainJob == 'true'
uses: actions/cache@v3
uses: actions/cache@v4
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' }}
- 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 # This stage sets up gradle caching
uses: eskatos/gradle-command-action@v2
with:
arguments: -PengineVersion=${{ matrix.es-version }} --info clean build koverXmlReport
- name: Build
run: ./gradlew -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
run: ./gradlew -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
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@v3
uses: actions/cache@v4
with:
path: build/integration/sudachi-dictionary-20230110-small.zip
key: sudachi-dictionary-20230110
Expand Down Expand Up @@ -114,33 +108,31 @@ jobs:
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
- uses: actions/upload-artifact@v4
name: Upload reports when failed
if: failure()
with:
name: failure-reports
name: failure-reports-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }}
path: |
build/reports
build/integration/elasticsearch-*/logs
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload built packages
if: success()
with:
name: build-artifacts
name: build-artifacts-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }}
path: |
build/distributions/*.zip
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload SPI jar
if: env.mainJob == 'true'
with:
name: build-artifacts
name: build-artifacts-spi-${{ env.ENGINE_KIND }}-${{ env.ENGINE_VERSION }}
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
run: ./gradlew -PengineVersion=${{ matrix.es-version }} --info publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_USERNAME: GITHUB_ACTOR
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit a336eef

Please sign in to comment.