Skip to content

Commit

Permalink
add support for windows build (opensearch-project#84)
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 authored Oct 28, 2022
1 parent c3a2dff commit dc26cac
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,58 @@ on:

jobs:
build:
env:
BUILD_ARGS: ${{ matrix.os_build_args }}
WORKING_DIR: ${{ matrix.working_directory }}.
strategy:
matrix:
java: [11, 17]
os: [ ubuntu-latest, windows-latest, macos-latest ]
include:
- 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

name: Build and Test
runs-on: ubuntu-latest
name: Build and Test security-analytics with JDK ${{ matrix.java }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
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: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Build and Test
run: |
./gradlew build
working-directory: ${{ env.WORKING_DIR }}
run: ./gradlew build ${{ env.BUILD_ARGS }}
env:
_JAVA_OPTIONS: ${{ matrix.os_java_options }}

- name: Publish to Maven Local
- name: Create Artifact Path
run: |
./gradlew publishToMavenLocal
mkdir -p security-analytics-artifacts
cp ./build/distributions/*.zip security-analytics-artifacts
- name: Upload Coverage Report
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: security-analytics-plugin-${{ matrix.os }}
path: security-analytics-artifacts
4 changes: 4 additions & 0 deletions src/main/resources/OSMapping/windows/fieldmappings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ fieldmappings:
fieldB: mappedB
fieldA1: mappedA
CommandLine: windows-event_data-CommandLine
HostName: windows-hostname
Message: windows-message
Provider_Name: windows-provider-name
ServiceName: windows-servicename
16 changes: 16 additions & 0 deletions src/main/resources/OSMapping/windows/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
"event_uid": {
"type": "alias",
"path": "EventID"
},
"windows-hostname": {
"type": "alias",
"path": "HostName"
},
"windows-message": {
"type": "alias",
"path": "Message"
},
"windows-provider-name": {
"type": "alias",
"path": "Provider_Name"
},
"windows-servicename": {
"type": "alias",
"path": "ServiceName"
}
}
}

0 comments on commit dc26cac

Please sign in to comment.