Skip to content

Commit 2a69d14

Browse files
committed
feat(ci): overhaul CI/CD with smart detection & optimized caching
Major improvements: - Intelligent change detection with dependency graph resolution - Only test affected components + transitive dependencies - Dual caching: sccache for artifacts + rust-cache for deps - Parallel matrix execution for all test suites - Python tests use server-start/stop instead of Docker - Centralized component config in components.yml - Unified test workflow handling all languages - Maven Nexus publishing for Java SDK - Multi-arch Docker builds with buildx - Manual tagging workflow for controlled releases - CI summary with execution times per component - License header & conventional commit validation Fixes: Missing Docker inputs, sccache persistence, order-sensitive pattern matching, empty duration column, Maven credentials. Reduces CI runtime by ~40% while improving reliability.
1 parent f2a3a75 commit 2a69d14

80 files changed

Lines changed: 4651 additions & 4944 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: csharp-dotnet
19+
description: .NET github iggy actions
20+
21+
inputs:
22+
task:
23+
description: "Task to run"
24+
required: true
25+
version:
26+
description: "Version for publishing"
27+
required: false
28+
default: ""
29+
dry_run:
30+
description: "Dry run mode"
31+
required: false
32+
default: "false"
33+
34+
runs:
35+
using: "composite"
36+
steps:
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v4
39+
with:
40+
dotnet-version: "8.0.x"
41+
42+
- name: Setup Rust
43+
run: |
44+
echo "Using Rust toolchain from rust-toolchain.toml: $(rustup show)"
45+
shell: bash
46+
47+
- name: Cache Rust dependencies
48+
if: inputs.task == 'test' || inputs.task == 'e2e'
49+
uses: Swatinem/rust-cache@v2
50+
with:
51+
cache-targets: false # Only cache registry and git deps, not target dir (sccache handles that)
52+
53+
- name: Setup sccache for Rust compilation
54+
if: inputs.task == 'test' || inputs.task == 'e2e'
55+
uses: ./.github/actions/setup-sccache
56+
57+
- name: Install netcat
58+
run: sudo apt-get update && sudo apt-get install -y netcat-openbsd
59+
shell: bash
60+
61+
- name: Restore dependencies
62+
run: |
63+
cd foreign/csharp
64+
dotnet restore
65+
shell: bash
66+
67+
- name: Build
68+
if: inputs.task == 'test' || inputs.task == 'build' || inputs.task == 'publish' || inputs.task == 'lint'
69+
run: |
70+
cd foreign/csharp
71+
dotnet build --no-restore
72+
shell: bash
73+
74+
- name: Lint (Code Analysis)
75+
if: inputs.task == 'lint'
76+
run: |
77+
cd foreign/csharp
78+
79+
# Run code analysis
80+
dotnet build --no-restore /p:EnforceCodeStyleInBuild=true /p:TreatWarningsAsErrors=false
81+
82+
# Format check (requires dotnet-format tool)
83+
if command -v dotnet-format &> /dev/null; then
84+
dotnet format --verify-no-changes --verbosity diagnostic
85+
else
86+
echo "dotnet-format not installed, skipping format check"
87+
fi
88+
shell: bash
89+
90+
- name: Test
91+
if: inputs.task == 'test'
92+
run: |
93+
cd foreign/csharp
94+
95+
# Run unit tests (matching old CI)
96+
dotnet test Iggy_SDK_Tests --no-build --verbosity normal
97+
98+
# Run integration tests
99+
dotnet test Iggy_SDK.Tests.Integration --no-build --verbosity normal
100+
101+
# Run BDD tests if they exist
102+
if [ -d "Iggy_SDK.Tests.BDD" ]; then
103+
dotnet test Iggy_SDK.Tests.BDD --no-build --verbosity normal
104+
fi
105+
shell: bash
106+
107+
- name: Start Iggy server
108+
id: iggy
109+
if: inputs.task == 'e2e'
110+
uses: ./.github/actions/server-start
111+
with:
112+
mode: cargo
113+
cargo-bin: iggy-server
114+
port: 8090
115+
116+
- name: Run integration tests
117+
if: inputs.task == 'e2e'
118+
run: |
119+
cd foreign/csharp
120+
dotnet test Iggy_SDK.Tests.Integration --no-build --verbosity normal
121+
shell: bash
122+
123+
- name: Stop Iggy server
124+
if: inputs.task == 'e2e'
125+
uses: ./.github/actions/server-stop
126+
with:
127+
pid-file: ${{ steps.iggy.outputs.pid_file }}
128+
log-file: ${{ steps.iggy.outputs.log_file }}
129+
130+
- name: Build Release
131+
if: inputs.task == 'build' || inputs.task == 'publish'
132+
run: |
133+
cd foreign/csharp
134+
135+
# Build in Release mode
136+
dotnet build -c Release --no-restore
137+
138+
# List build output
139+
echo "Build output:"
140+
find . -name "*.dll" -path "*/bin/Release/*" | head -20 || echo "No DLLs found in Release folders"
141+
shell: bash
142+
143+
- name: Pack NuGet packages
144+
if: inputs.task == 'publish'
145+
run: |
146+
cd foreign/csharp
147+
148+
# Set version if provided
149+
if [ -n "${{ inputs.version }}" ]; then
150+
dotnet pack -c Release \
151+
-p:PackageVersion=${{ inputs.version }} \
152+
-o ./nupkgs \
153+
--no-build
154+
else
155+
dotnet pack -c Release -o ./nupkgs --no-build
156+
fi
157+
158+
# List packages
159+
echo "NuGet packages:"
160+
ls -la ./nupkgs/ || echo "No packages found"
161+
shell: bash
162+
163+
- name: Publish to NuGet
164+
if: inputs.task == 'publish'
165+
env:
166+
NUGET_API_KEY: ${{ env.NUGET_API_KEY }}
167+
run: |
168+
cd foreign/csharp
169+
170+
if [ "${{ inputs.dry_run }}" = "true" ]; then
171+
echo "Dry run - would publish these packages:"
172+
ls -la ./nupkgs/*.nupkg
173+
else
174+
# Push to NuGet
175+
for package in ./nupkgs/*.nupkg; do
176+
dotnet nuget push "$package" \
177+
--api-key "$NUGET_API_KEY" \
178+
--source https://api.nuget.org/v3/index.json \
179+
--skip-duplicate
180+
done
181+
fi
182+
shell: bash

0 commit comments

Comments
 (0)