Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds test and build workflow for mac and windows #210

Merged
merged 14 commits into from
Dec 8, 2021
37 changes: 30 additions & 7 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Test and Build Workflow
# This workflow is triggered on pull requests to main or a opendistro release branch
on:
pull_request:
branches:
Expand All @@ -12,8 +11,23 @@ jobs:
build:
# Job name
name: Build Index Management
# This job runs on Linux
runs-on: ubuntu-latest
env:
BUILD_ARGS: -D"opensearch.version=1.3.0-SNAPSHOT" ${{ matrix.os_build_args }}
WORKING_DIR: ${{ matrix.working_directory }}.
strategy:
# This setting says that all jobs should finish, even if one fails
fail-fast: false
# This starts three jobs, setting these environment variables uniquely for the different jobs
matrix:
include:
- os: ubuntu-latest
- os: windows-latest
os_build_args: -x integTest -x jacocoTestReport
working_directory: X:\
os_java_options: -Xmx4096M
- os: macos-latest
os_build_args: -x integTest -x jacocoTestReport
runs-on: ${{ matrix.os }}
steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK 14
Expand All @@ -23,25 +37,34 @@ jobs:
# build index management
- name: Checkout Branch
uses: actions/checkout@v2
# This is a hack, but this step creates a link to the X: mounted drive, which makes the path
# short enough to work on Windows
- name: Shorten Path
if: ${{ matrix.os == 'windows-latest' }}
run: subst 'X:' .
- name: Build with Gradle
run: ./gradlew build -Dopensearch.version=1.3.0-SNAPSHOT
working-directory: ${{ env.WORKING_DIR }}
run: ./gradlew build ${{ env.BUILD_ARGS }}
env:
_JAVA_OPTIONS: ${{ matrix.os_java_options }}
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
if: ${{ failure() && matrix.os == 'ubuntu-latest' }}
with:
name: logs
path: build/testclusters/integTest-*/logs/*
- name: Create Artifact Path
run: |
mkdir -p index-management-artifacts
cp ./build/distributions/*.zip index-management-artifacts
cp ./build/distributions/*.zip index-management-artifacts
- name: Uploads coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: index-management-plugin
name: index-management-plugin-${{ matrix.os }}
path: index-management-artifacts