Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
68 changes: 68 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# GitHub Workflows

This directory contains the GitHub Actions workflows for the Hoptimator project.

## Workflows

### CI (`ci.yml`)
**Purpose:** Fast feedback for pull requests and commits to main.

**Triggers:**
- Pull requests to `main`
- Pushes to `main`

**What it does:**
- Validates Gradle wrapper for security
- Builds the project (excluding integration tests and shadowJar)
- Runs unit tests
- Runs Checkstyle for code style validation
- Runs SpotBugs for static analysis
- Uploads test reports, Checkstyle results, and SpotBugs results on failure

**Typical duration:** 5-10 minutes

### Build and Test (`integration-tests.yml`)
**Purpose:** Comprehensive testing with full integration test suite.

**Triggers:**
- Pull requests to `main`
- Pushes to `main`

**What it does:**
- Full build including Docker images
- Sets up a Kubernetes Kind cluster
- Deploys required services (Kafka, Flink, etc.)
- Runs integration tests
- Captures extensive debugging information (logs, cluster state, etc.)

**Typical duration:** 15-20 minutes

### Publish release packages (`release.yml`)
**Purpose:** Publishes release artifacts when a new release is created.

**Triggers:**
- Release created events

**What it does:**
- Validates Gradle wrapper
- Publishes packages to JFrog and GitHub Packages

## Development Workflow

When you create a pull request:
1. The **CI workflow** runs first, providing quick feedback on basic build and test issues
2. The **Build and Test workflow** runs in parallel, validating integration tests
3. Both must pass before the PR can be merged

## Local Testing

To run the same checks locally:

```bash
# Run what CI workflow runs
./gradlew build -x intTest -x shadowJar

# Run what Build and Test workflow runs (requires Kubernetes cluster)
make build
make integration-tests-kind
```
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

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

permissions:
contents: read

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1

- name: Build and run unit tests
run: ./gradlew build -x intTest -x shadowJar

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
**/build/reports/tests/test/
**/build/test-results/test/

- name: Upload Checkstyle results
if: failure()
uses: actions/upload-artifact@v4
with:
name: checkstyle-results
path: |
**/build/reports/checkstyle/

- name: Upload SpotBugs results
if: failure()
uses: actions/upload-artifact@v4
with:
name: spotbugs-results
path: |
**/build/reports/spotbugs/