-
Notifications
You must be signed in to change notification settings - Fork 1
fix component name inconsistencies and add ci test pipeline #13
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
Open
christianhuening
wants to merge
2
commits into
main
Choose a base branch
from
fix-issues-and-add-ci-quality-checks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,147 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| # --------------------------------------------------------------------------- | ||
| # Detect which component directories changed | ||
| # --------------------------------------------------------------------------- | ||
| detect-changes: | ||
| runs-on: arc-scale-set | ||
| permissions: | ||
| pull-requests: read | ||
| outputs: | ||
| cloudnative-pg: ${{ steps.changes.outputs.cloudnative-pg }} | ||
| keycloak: ${{ steps.changes.outputs.keycloak }} | ||
| artifact-conduit: ${{ steps.changes.outputs.artifact-conduit }} | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Detect changed paths (PR only) | ||
| if: github.event_name == 'pull_request' | ||
| uses: dorny/paths-filter@v3 | ||
| id: filter | ||
| with: | ||
| filters: | | ||
| cloudnative-pg: | ||
| - 'cloudnative-pg/**' | ||
| keycloak: | ||
| - 'keycloak/**' | ||
| artifact-conduit: | ||
| - 'artifact-conduit/**' | ||
|
|
||
| - name: Resolve changes | ||
| id: changes | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | ||
| { | ||
| echo "cloudnative-pg=${{ steps.filter.outputs.cloudnative-pg }}" | ||
| echo "keycloak=${{ steps.filter.outputs.keycloak }}" | ||
| echo "artifact-conduit=${{ steps.filter.outputs.artifact-conduit }}" | ||
| } >> "$GITHUB_OUTPUT" | ||
| else | ||
| # push to main or workflow_dispatch → test everything | ||
| { | ||
| echo "cloudnative-pg=true" | ||
| echo "keycloak=true" | ||
| echo "artifact-conduit=true" | ||
| } >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Validate OCM component descriptors (always runs for all 3 components) | ||
| # --------------------------------------------------------------------------- | ||
| validate: | ||
| runs-on: arc-scale-set | ||
| timeout-minutes: 15 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - component: artifact-conduit | ||
| path: ./artifact-conduit | ||
| - component: cloudnative-pg | ||
| path: ./cloudnative-pg | ||
| - component: keycloak | ||
| path: ./keycloak | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up OCM CLI | ||
| uses: open-component-model/ocm-setup-action@8c71929f38d3486e352e5d7aaf813f36accaaf43 | ||
|
|
||
| - name: Build OCM component (dry-run) | ||
| run: | | ||
| cd "${{ matrix.path }}" | ||
| ocm add componentversion \ | ||
| --version 0.0.0-ci \ | ||
| --create \ | ||
| --file ./ctf \ | ||
| component-constructor.yaml | ||
|
|
||
| - name: Verify resources resolve | ||
| run: | | ||
| cd "${{ matrix.path }}" | ||
| ocm get resources ./ctf | ||
|
|
||
| - name: Clean up CTF | ||
| if: always() | ||
| run: rm -rf "${{ matrix.path }}/ctf" | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Integration tests (reusable workflows) | ||
| # --------------------------------------------------------------------------- | ||
| test-cloudnative-pg: | ||
| needs: [detect-changes, validate] | ||
| if: needs.detect-changes.outputs.cloudnative-pg == 'true' | ||
| uses: ./.github/workflows/test-cloudnative-pg.yml | ||
|
|
||
| test-keycloak: | ||
| needs: [detect-changes, validate] | ||
| if: needs.detect-changes.outputs.keycloak == 'true' | ||
| uses: ./.github/workflows/test-keycloak.yml | ||
|
|
||
| test-artifact-conduit: | ||
| needs: [detect-changes, validate] | ||
| if: needs.detect-changes.outputs.artifact-conduit == 'true' | ||
| uses: ./.github/workflows/test-artifact-conduit.yml | ||
| secrets: inherit | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Gate job for branch protection (single required status check) | ||
| # --------------------------------------------------------------------------- | ||
| ci-success: | ||
| if: always() | ||
| needs: | ||
| - detect-changes | ||
| - validate | ||
| - test-cloudnative-pg | ||
| - test-keycloak | ||
| - test-artifact-conduit | ||
| runs-on: arc-scale-set | ||
| steps: | ||
| - name: Evaluate job results | ||
| run: | | ||
| results=( \ | ||
| "${{ needs.detect-changes.result }}" \ | ||
| "${{ needs.validate.result }}" \ | ||
| "${{ needs.test-cloudnative-pg.result }}" \ | ||
| "${{ needs.test-keycloak.result }}" \ | ||
| "${{ needs.test-artifact-conduit.result }}" \ | ||
| ) | ||
| for r in "${results[@]}"; do | ||
| if [[ "$r" == "failure" || "$r" == "cancelled" ]]; then | ||
| echo "::error::Job failed or was cancelled: $r" | ||
| exit 1 | ||
| fi | ||
| done | ||
| echo "All jobs passed (success or skipped)." | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: "Test: Artifact Conduit" | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| GITHUB_TOKEN: | ||
| required: true | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: arc-scale-set | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Create kind cluster | ||
| uses: helm/kind-action@v1 | ||
| with: | ||
| cluster_name: arc-test | ||
|
|
||
| - name: Install cert-manager | ||
| run: | | ||
| kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml | ||
| echo "Waiting for cert-manager deployments..." | ||
| kubectl wait --for=condition=Available deployment/cert-manager \ | ||
| -n cert-manager --timeout=120s | ||
| kubectl wait --for=condition=Available deployment/cert-manager-webhook \ | ||
| -n cert-manager --timeout=120s | ||
| kubectl wait --for=condition=Available deployment/cert-manager-cainjector \ | ||
| -n cert-manager --timeout=120s | ||
|
|
||
| - name: Login to GHCR (Helm OCI) | ||
| run: | | ||
| echo "${{ secrets.GITHUB_TOKEN }}" | \ | ||
| helm registry login ghcr.io -u "${{ github.actor }}" --password-stdin | ||
|
|
||
| - name: Install Artifact Conduit via Helm | ||
| run: | | ||
| helm install arc \ | ||
| oci://ghcr.io/opendefensecloud/charts/arc \ | ||
| --version v0.2.1 \ | ||
| --namespace arc-system \ | ||
| --create-namespace \ | ||
| -f artifact-conduit/minimal-values.yaml \ | ||
| --wait \ | ||
| --timeout 5m | ||
|
|
||
| - name: Verify deployments | ||
| run: | | ||
| kubectl wait --for=condition=Available deployment \ | ||
| -l app.kubernetes.io/instance=arc \ | ||
| -n arc-system \ | ||
| --timeout=180s | ||
| echo "--- Running pods ---" | ||
| kubectl get pods -n arc-system | ||
|
|
||
| - name: Collect debug info on failure | ||
| if: failure() | ||
| run: | | ||
| echo "--- Pods ---" | ||
| kubectl get pods -A | ||
| echo "--- Deployments ---" | ||
| kubectl get deployments -n arc-system -o wide || true | ||
| echo "--- Events ---" | ||
| kubectl get events -n arc-system --sort-by='.lastTimestamp' || true | ||
| echo "--- Helm status ---" | ||
| helm status arc -n arc-system || true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.