build #867
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 | |
on: | |
push: | |
branches: [main, "REL-*"] | |
workflow_dispatch: | |
inputs: | |
skipTests: | |
description: 'Skip tests' | |
required: true | |
default: 'false' | |
env: | |
skipTests: false | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# Unable to parse command line options: Unrecognized option: -inputFormat -> I don't get it, lets skip windows builds for now | |
# os: [ ubuntu-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
java: 21 | |
target: 'test' | |
# os: windows-latest | |
# java: 17 | |
# target: 'test' | |
- os: ubuntu-latest | |
java: 17 | |
target: 'deploy' | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Cancel previous Action | |
uses: styfle/[email protected] | |
if: github.ref == 'refs/heads/main' | |
- uses: getong/[email protected] | |
with: | |
elasticsearch version: '7.9.0' | |
if: runner.os == 'Linux' | |
- uses: actions/[email protected] | |
- name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
server-id: vpro-ossrh | |
server-username: SONATYPE_USERNAME | |
server-password: SONATYPE_PASSWORD | |
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} | |
gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE | |
cache: maven | |
- name: Build and ${{ matrix.target }} with Maven | |
run: "mvn -ntp -fae -DskipITs=false -DskipTests=${skipTests} -Dinteg.cluster.name=docker-elasticsearch -B -P'deploy,sonatype' ${{ matrix.target }} -Dgpg.skip=false" | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_SECRET_KEY_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }} | |
continue-on-error: ${{ matrix.target != 'deploy' }} | |
- name: Publish to codecov | |
uses: codecov/[email protected] | |
continue-on-error: true | |
if: matrix.target == 'deploy' | |
- name: Publish Unit Test Results | |
uses: EnricoMi/[email protected] | |
if: always() && runner.os == 'Linux' | |
with: | |
check_name: Tests results java ${{ matrix.java }}, os ${{ matrix.os }} | |
junit_files: "**/target/surefire-reports/*.xml" |