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
| # Example: Calling the Reusable Workflow with Manual Package Selection | ||
| # This demonstrates how to use the reusable workflow with manually specified packages | ||
| name: Example - Build with Manual Package Selection | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| packages: | ||
| description: 'Package names (comma-separated, e.g., V15,V16,V33)' | ||
| required: true | ||
| type: string | ||
| project_name: | ||
| description: 'DBmaestro project name' | ||
| required: false | ||
| type: string | ||
| default: 'Demo-PSQL' | ||
| jobs: | ||
| # Prepare package matrix from comma-separated input | ||
| prepare_matrix: | ||
| name: Prepare Package Matrix | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| matrix: ${{ steps.create-matrix.outputs.matrix }} | ||
| steps: | ||
| - name: Create Matrix from Input | ||
| id: create-matrix | ||
| shell: bash | ||
| run: | | ||
| # Convert comma-separated packages to JSON array | ||
| IFS=',' read -ra PACKAGES <<< "${{ inputs.packages }}" | ||
| matrix="[" | ||
| first=true | ||
| for pkg in "${PACKAGES[@]}"; do | ||
| # Trim whitespace | ||
| pkg=$(echo "$pkg" | xargs) | ||
| if [ -n "$pkg" ]; then | ||
| if [ "$first" = false ]; then | ||
| matrix="$matrix," | ||
| fi | ||
| matrix="$matrix{\"package\":\"$pkg\"}" | ||
| first=false | ||
| fi | ||
| done | ||
| matrix="$matrix]" | ||
| echo "Generated matrix: $matrix" | ||
| echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
| # Call the reusable workflow with the package matrix | ||
| build_and_validate: | ||
| name: Build and Validate Packages | ||
| needs: prepare_matrix | ||
| uses: ./.github/workflows/linux/reusable-build-validate.yml | ||
|
Check failure on line 55 in .github/workflows/example-build-manual-input.yml
|
||
| with: | ||
| project-name: ${{ inputs.project_name }} | ||
| packages-matrix: ${{ needs.prepare_matrix.outputs.matrix }} | ||
| packages-folder: 'packages' | ||
| agent-jar-path: '/home/runner/DBmaestroAgent.jar' | ||
| use-ssl: 'True' | ||
| auth-type: 'DBmaestroAccount' | ||
| package-type: 'Regular' | ||
| runner: 'dbmaestro-linux' | ||
| secrets: | ||
| dbmaestro-server: ${{ vars.DBMAESTRO_SERVER }} | ||
| dbmaestro-user: ${{ secrets.DBMAESTRO_USER }} | ||
| dbmaestro-password: ${{ secrets.DBMAESTRO_PASSWORD }} | ||
| # Optional: Summary job | ||
| summary: | ||
| name: Workflow Summary | ||
| runs-on: ubuntu-latest | ||
| needs: [prepare_matrix, build_and_validate] | ||
| if: always() | ||
| steps: | ||
| - name: Display Summary | ||
| run: | | ||
| cat >> $GITHUB_STEP_SUMMARY << EOF | ||
| ## Package Build and Validation Summary | ||
| | Property | Value | | ||
| |----------|-------| | ||
| | **Project Name** | ${{ inputs.project_name }} | | ||
| | **Packages** | ${{ inputs.packages }} | | ||
| | **Matrix** | \`${{ needs.prepare_matrix.outputs.matrix }}\` | | ||
| | **Build Status** | ${{ needs.build_and_validate.result }} | | ||
| | **Overall Result** | ${{ needs.build_and_validate.result == 'success' && '✅ Success' || '❌ Failed' }} | | ||
| EOF | ||