Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@
/local_data
/performance_results
/scripts
**/target
/target
!/target/debug/iggy
!/target/debug/iggy-server
!/target/debug/iggy-mcp
!/target/debug/iggy-connectors
/web
110 changes: 110 additions & 0 deletions .github/actions/csharp-dotnet/post-merge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: csharp-dotnet-post-merge
description: .NET post-merge publishing github iggy actions

inputs:
version:
description: "Version for publishing"
required: true
dry_run:
description: "Dry run mode"
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Restore dependencies
run: |
cd foreign/csharp
dotnet restore
shell: bash

- name: Build Release
run: |
cd foreign/csharp

# Build in Release mode
dotnet build -c Release --no-restore

# List build output
echo "Build output:"
find . -name "*.dll" -path "*/bin/Release/*" | head -20 || echo "No DLLs found in Release folders"
shell: bash

- name: Pack NuGet packages
run: |
cd foreign/csharp

# Set version if provided
if [ -n "${{ inputs.version }}" ]; then
dotnet pack ./Iggy_SDK -c Release \
-p:PackageVersion=${{ inputs.version }} \
-o ./nupkgs \
--no-build
else
echo "❌ Version is required for packing"
exit 1
fi

# List packages
echo "NuGet packages:"
ls -la ./nupkgs/ || echo "No packages found"
shell: bash

- name: Publish to NuGet
env:
NUGET_API_KEY: ${{ env.NUGET_API_KEY }}
run: |
cd foreign/csharp

if [ "${{ inputs.dry_run }}" = "true" ]; then
echo "🔍 Dry run - would publish these packages:"
ls -la ./nupkgs/*.nupkg

# Validate packages
for package in ./nupkgs/*.nupkg; do
echo "Validating: $package"
dotnet nuget locals all --clear
# Extract package info
unzip -l "$package" | head -20
done
else
if [ -z "$NUGET_API_KEY" ]; then
echo "❌ NUGET_API_KEY is not set"
exit 1
fi

echo "📦 Publishing packages to NuGet..."
# Push to NuGet
for package in ./nupkgs/*.nupkg; do
echo "Publishing: $(basename $package)"
dotnet nuget push "$package" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
done
echo "✅ Publishing completed"
fi
shell: bash
123 changes: 123 additions & 0 deletions .github/actions/csharp-dotnet/pre-merge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# TODO(hubcio): Currently, C# tests don't need server. They use testcontainers with 'edge' image.
# We should change this to use server-start/stop action, so that code from PR is tested.

name: csharp-dotnet-pre-merge
description: .NET pre-merge testing github iggy actions

inputs:
task:
description: "Task to run (lint, test, build, e2e)"
required: true

runs:
using: "composite"
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Setup Rust with cache
if: inputs.task == 'test' || inputs.task == 'e2e'
uses: ./.github/actions/utils/setup-rust-with-cache
with:
cache-targets: false # Only cache registry and git deps, not target dir (sccache handles that)

- name: Install netcat
if: inputs.task == 'e2e'
run: sudo apt-get update && sudo apt-get install -y netcat-openbsd
shell: bash

- name: Restore dependencies
run: |
cd foreign/csharp
dotnet restore
shell: bash

- name: Build
if: inputs.task == 'test' || inputs.task == 'build' || inputs.task == 'lint'
run: |
cd foreign/csharp
dotnet build --no-restore
shell: bash

- name: Lint (Code Analysis)
if: inputs.task == 'lint'
run: |
cd foreign/csharp

# Run code analysis
dotnet build --no-restore /p:EnforceCodeStyleInBuild=true /p:TreatWarningsAsErrors=false

# TODO: make format check blocking (requires dotnet-format tool)
dotnet format --verify-no-changes --verbosity diagnostic || true

shell: bash

- name: Test
if: inputs.task == 'test'
run: |
cd foreign/csharp

# Run unit tests
dotnet test Iggy_SDK_Tests --no-build --verbosity normal

# Run integration tests
dotnet test Iggy_SDK.Tests.Integration --no-build --verbosity normal

shell: bash

# TODO(hubcio): currently, C# tests don't need server. They use testcontainers with 'edge' image.
# instead, they should use server-start/stop action to test the actual code from PR.
# - name: Start Iggy server
# id: iggy
# if: inputs.task == 'e2e'
# uses: ./.github/actions/utils/server-start
# with:
# mode: cargo
# cargo-bin: iggy-server
# port: 8090

- name: Run integration tests
if: inputs.task == 'e2e'
run: |
cd foreign/csharp
dotnet test Iggy_SDK.Tests.Integration --no-build --verbosity normal
shell: bash

- name: Stop Iggy server
if: inputs.task == 'e2e'
uses: ./.github/actions/utils/server-stop
with:
pid-file: ${{ steps.iggy.outputs.pid_file }}
log-file: ${{ steps.iggy.outputs.log_file }}

- name: Build Release
if: inputs.task == 'build'
run: |
cd foreign/csharp

# Build in Release mode
dotnet build -c Release --no-restore

# List build output
echo "Build output:"
find . -name "*.dll" -path "*/bin/Release/*" | head -20 || echo "No DLLs found in Release folders"
shell: bash
118 changes: 118 additions & 0 deletions .github/actions/go/post-merge/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: go-post-merge
description: Go post-merge tag preparation github iggy actions

inputs:
version:
description: "Version for tagging (without 'v' prefix)"
required: true
dry_run:
description: "Dry run mode"
required: false
default: "false"

runs:
using: "composite"
steps:
- name: Validate version format
run: |
VERSION="${{ inputs.version }}"

# Check if version matches semantic versioning
if ! echo "$VERSION" | grep -E '^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$' > /dev/null; then
echo "❌ Invalid version format: $VERSION"
echo "Expected format: X.Y.Z or X.Y.Z-prerelease+metadata"
exit 1
fi

echo "✅ Version format valid: $VERSION"
shell: bash

- name: Prepare Go module for tagging
run: |
VERSION="${{ inputs.version }}"
TAG="foreign/go/v${VERSION}"

echo "📦 Go Module Publishing Information"
echo "===================================="
echo "Version: v${VERSION}"
echo "Git tag: ${TAG}"
echo ""

if [ "${{ inputs.dry_run }}" = "true" ]; then
echo "🔍 DRY RUN MODE - No tag will be created"
echo ""
echo "Would create tag: ${TAG}"
echo ""
echo "After tagging, users could import using:"
echo " go get github.com/${{ github.repository }}/foreign/go@v${VERSION}"
echo ""
echo "Or add to go.mod:"
echo " require github.com/${{ github.repository }}/foreign/go v${VERSION}"
else
echo "✅ Go module ready for tagging"
echo ""
echo "Tag will be created: ${TAG}"
echo "This will be handled by the create-tags job in the publish workflow"
echo ""
echo "After the tag is pushed, users can import using:"
echo " go get github.com/${{ github.repository }}/foreign/go@v${VERSION}"
echo ""
echo "Or add to go.mod:"
echo " require github.com/${{ github.repository }}/foreign/go v${VERSION}"
fi

# Verify the go.mod file exists
if [ ! -f "foreign/go/go.mod" ]; then
echo "⚠️ Warning: foreign/go/go.mod not found"
echo "Make sure the Go module is properly initialized"
else
echo ""
echo "Module information:"
grep "^module" foreign/go/go.mod || echo "Module declaration not found"
fi
shell: bash

- name: Output tag information
id: tag-info
run: |
VERSION="${{ inputs.version }}"
TAG="foreign/go/v${VERSION}"

# Set outputs for use in other jobs
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "version=v${VERSION}" >> "$GITHUB_OUTPUT"

# Summary for GitHub Actions
{
echo "## 🏷️ Go Module Tag Information"
echo ""
echo "| Property | Value |"
echo "|----------|-------|"
echo "| **Version** | \`v${VERSION}\` |"
echo "| **Git Tag** | \`${TAG}\` |"
echo "| **Import Path** | \`github.com/${{ github.repository }}/foreign/go\` |"
echo ""
if [ "${{ inputs.dry_run }}" = "true" ]; then
echo "**Note:** This is a dry run - no actual tag will be created"
else
echo "**Note:** Tag will be created by the publish workflow"
fi
} >> "$GITHUB_STEP_SUMMARY"
shell: bash
Loading
Loading