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

GitHub Action for build and test #66

Merged
merged 50 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f550b5d
[CYB-171] test fix
stas-panasiuk Feb 12, 2024
9b06d3f
Create build_and_test.yml
stas-panasiuk Feb 12, 2024
976e785
Updated cache logic
stas-panasiuk Feb 12, 2024
8235351
Reverted previous change
stas-panasiuk Feb 12, 2024
06705e2
fixed the action
stas-panasiuk Feb 12, 2024
90c71db
trigger commit
stas-panasiuk Feb 12, 2024
18fcbf5
update to save init index
stas-panasiuk Feb 12, 2024
e58508a
possible github actions test fix
stas-panasiuk Feb 12, 2024
39d9dc1
made github action run problematic part only
stas-panasiuk Feb 12, 2024
f6f5c03
added logs
stas-panasiuk Feb 12, 2024
110ac10
added setup logs
stas-panasiuk Feb 12, 2024
c947125
surefire update
stas-panasiuk Feb 12, 2024
c033ef5
maven assembly fix
stas-panasiuk Feb 12, 2024
8d1c7b1
logs
stas-panasiuk Feb 12, 2024
d8003db
context logs
stas-panasiuk Feb 12, 2024
cf0b30f
revert + test on java 11
stas-panasiuk Feb 12, 2024
e45cb36
adopt 8 jdk
stas-panasiuk Feb 12, 2024
d86eb40
revert everything
stas-panasiuk Feb 12, 2024
5079e00
Merge branch 'CYB-171' into build_and_test_ci
stas-panasiuk Feb 12, 2024
b48b7e4
import fix
stas-panasiuk Feb 12, 2024
3154a8a
cache fix
stas-panasiuk Feb 12, 2024
27584eb
dependency graph dynamic directory
stas-panasiuk Feb 12, 2024
2a4e73e
dependency graph dynamic directory #2
stas-panasiuk Feb 12, 2024
c06f901
dependency graph dynamic directory revert
stas-panasiuk Feb 12, 2024
9967060
cache works, build and test uncommented
stas-panasiuk Feb 12, 2024
ff8443c
full build test
stas-panasiuk Feb 12, 2024
0a0ed3f
proper cache init
stas-panasiuk Feb 12, 2024
78bff5e
trying to build in a different image
stas-panasiuk Feb 13, 2024
5d8f7e9
cache test
stas-panasiuk Feb 12, 2024
7db18bc
maven assembly fix
stas-panasiuk Feb 13, 2024
15dee0c
fixed failing test
stas-panasiuk Feb 13, 2024
f62e3ba
full build
stas-panasiuk Feb 13, 2024
97ed0c3
reverted surefire version
stas-panasiuk Feb 13, 2024
c2959dc
combined build and test
stas-panasiuk Feb 13, 2024
aeb3176
maven m2 path debug
stas-panasiuk Feb 13, 2024
afc6a50
updated maven m2 location
stas-panasiuk Feb 13, 2024
e255da9
removed dependency update to check cache
stas-panasiuk Feb 13, 2024
ccc9469
checking cache
stas-panasiuk Feb 13, 2024
5192b8a
full build
stas-panasiuk Feb 13, 2024
1d9b7f6
build_and_test should only trigger in PRs + added java 11,17,21 pipel…
stas-panasiuk Feb 13, 2024
6443328
Renamed future compatibility job
stas-panasiuk Feb 13, 2024
5becbdc
future compatibility job should fail on error
stas-panasiuk Feb 14, 2024
c84aaf3
future compatibility should build on the default branch only
stas-panasiuk Feb 14, 2024
ad484f1
Added exclusion for sun.jdk to support java 11
stas-panasiuk Feb 14, 2024
fa1ad73
Added cache to the weekly job
stas-panasiuk Feb 14, 2024
a782828
final cleanup
stas-panasiuk Feb 14, 2024
97e29d2
Added readme test badge
stas-panasiuk Feb 15, 2024
674380e
trigger commit
stas-panasiuk Feb 16, 2024
0b6ac54
Merge branch 'develop' into build_and_test_ci
stas-panasiuk Feb 16, 2024
b615e92
renamed future java compatibility job
stas-panasiuk Feb 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java 8 Build and Test

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

jobs:
build_and_test_java8:
runs-on: ubuntu-latest
container: maven:3-eclipse-temurin-8
steps:
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: /root/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test with Maven
run: mvn -B package --file flink-cyber/pom.xml
# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
with:
directory: /home/runner/work/cybersec/cybersec/flink-cyber
60 changes: 60 additions & 0 deletions .github/workflows/build_and_test_future_java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Future Java Compatibility Test

on:
schedule:
# At 2:30am each Saturday on the default branch
- cron: '30 2 * * 6'

jobs:
build_and_test_java11:
runs-on: ubuntu-latest
container: maven:3-eclipse-temurin-11
steps:
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test with Maven
run: mvn -B package --file flink-cyber/pom.xml

build_and_test_java17:
runs-on: ubuntu-latest
container: maven:3-eclipse-temurin-17
steps:
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test with Maven
run: mvn -B package --file flink-cyber/pom.xml

build_and_test_java21:
runs-on: ubuntu-latest
container: maven:3-eclipse-temurin-21
steps:
- uses: actions/checkout@v3
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and Test with Maven
run: mvn -B package --file flink-cyber/pom.xml
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Cybersec Toolkit

[![Java CI with Maven](https://github.com/cloudera/cybersec/actions/workflows/build_and_test.yml/badge.svg)](https://github.com/cloudera/cybersec/actions/workflows/build_and_test.yml)

## Overview
Enterprises deploy many point solutions to defend their networks. These point solutions provide a wealth of data about the enterprise assets and networks but it is difficult to provide analytics on this data because there is no common repository and the events are in different formats. The Cybersec Toolkit is a pipeline that ingests, correlates and prepares cybersecurity data for analytics. The Cyber Toolkit leverages the Cloudera Data Platform to build a Security Data Lakehouse.

Expand Down
1 change: 1 addition & 0 deletions flink-cyber/cyber-jobs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,12 @@
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
Expand Down
1 change: 1 addition & 0 deletions flink-cyber/flink-stellar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ public void restGetShouldHandleIOException() throws IOException {

Object result = restGet.apply(Collections.singletonList("http://www.host.com:8080/some/uri"), context);
assertNull(result);
restGet.close();
}

@Test
Expand Down
5 changes: 4 additions & 1 deletion flink-cyber/metron-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,12 @@
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptor>src/main/assembly/assembly.xml</descriptor>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
Expand Down
2 changes: 0 additions & 2 deletions flink-cyber/metron-parser-chain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-source-plugin.version>3.2.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
<maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version>
<frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
<frontend-maven-plugin.nodeVersion>v14.16.0</frontend-maven-plugin.nodeVersion>

Expand Down Expand Up @@ -327,7 +326,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
Expand Down
14 changes: 14 additions & 0 deletions flink-cyber/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<multiline-string.version>0.1.2</multiline-string.version>
<testcontainers.version>1.15.0</testcontainers.version>
<maven-shade-plugin.version>3.2.4</maven-shade-plugin.version>
<maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
Expand Down Expand Up @@ -534,6 +535,12 @@
<artifactId>multiline-string</artifactId>
<version>${multiline-string.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>sun.jdk</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -571,6 +578,13 @@
</executions>
</plugin>

<!-- Assembly -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
</plugin>

<!-- NiFi Nar Builder -->
<plugin>
<groupId>org.apache.nifi</groupId>
Expand Down
Loading