blob: d496ef7b0ef9c373dab1a9e63a45843fbf936810 [file] [log] [blame]
# 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: _test
on:
workflow_call:
inputs:
component:
type: string
required: true
description: "Component to test"
task:
type: string
required: true
description: "Task to run"
permissions:
contents: read
security-events: write
jobs:
run:
runs-on: ubuntu-latest
timeout-minutes: 60
env:
IGGY_CI_BUILD: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Skip noop
if: inputs.component == 'noop'
run: echo "No changes detected, skipping tests"
# Rust
- name: Run Rust task
if: startsWith(inputs.component, 'rust')
uses: ./.github/actions/rust/pre-merge
with:
task: ${{ inputs.task }}
component: ${{ inputs.component }}
# Python SDK
- name: Set up Docker Buildx for Python
if: inputs.component == 'sdk-python' && inputs.task == 'test'
uses: docker/setup-buildx-action@v3
- name: Run Python SDK task
if: inputs.component == 'sdk-python'
uses: ./.github/actions/python-maturin/pre-merge
with:
task: ${{ inputs.task }}
# Node SDK
- name: Run Node SDK task
if: inputs.component == 'sdk-node'
uses: ./.github/actions/node-npm/pre-merge
with:
task: ${{ inputs.task }}
# Go SDK
- name: Run Go SDK task
if: inputs.component == 'sdk-go'
uses: ./.github/actions/go/pre-merge
with:
task: ${{ inputs.task }}
# Java SDK
- name: Run Java SDK task
if: inputs.component == 'sdk-java'
uses: ./.github/actions/java-gradle/pre-merge
with:
task: ${{ inputs.task }}
# C# SDK
- name: Run C# SDK task
if: inputs.component == 'sdk-csharp'
uses: ./.github/actions/csharp-dotnet/pre-merge
with:
task: ${{ inputs.task }}
# Web UI
- name: Run Web UI task
if: inputs.component == 'web-ui'
run: |
cd web
npm ci
if [ "${{ inputs.task }}" = "lint" ]; then
# TODO(hubcio): make this blocking once Web UI lints are fixed
npm run lint || true
elif [ "${{ inputs.task }}" = "build" ]; then
npm run build
fi
# CI workflow validation
- name: Validate CI workflows
if: inputs.component == 'ci-workflows' && inputs.task == 'validate'
run: |
echo "Validating GitHub Actions workflows..."
# Basic YAML validation
for workflow in .github/workflows/*.yml; do
echo "Checking $workflow"
python -c "import yaml; yaml.safe_load(open('$workflow'))" || exit 1
done
echo "All workflows are valid YAML"
# Upload reports
- name: Upload reports
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.component }}-${{ inputs.task }}-reports-${{ github.run_id }}-${{ github.run_attempt }}
path: |
reports/**
target/llvm-cov/**
coverage.lcov
if-no-files-found: ignore
retention-days: 7