feat: Decouple cert-manager from base kubespray installation #795
Workflow file for this run
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
| --- | |
| name: Running hyperconverged smoke tests | |
| "on": | |
| workflow_dispatch: | |
| inputs: | |
| acmeEmail: | |
| description: Set email for ACME | |
| required: true | |
| default: "[email protected]" | |
| type: string | |
| gatewayDomain: | |
| description: Set domain for the gateway | |
| required: true | |
| default: cloud.local | |
| type: string | |
| osImage: | |
| description: Set OS image | |
| required: true | |
| default: "Ubuntu 24.04" | |
| type: choice | |
| options: | |
| - "Ubuntu 24.04" | |
| - "Ubuntu 22.04" | |
| - "Debian 12" | |
| sshUsername: | |
| description: Set SSH username | |
| required: true | |
| default: "ubuntu" | |
| type: choice | |
| options: | |
| - "ubuntu" | |
| - "debian" | |
| mode: | |
| description: Set mode | |
| required: true | |
| default: "test" | |
| type: choice | |
| options: | |
| - "test" | |
| - "deploy" | |
| - "cleanup" | |
| run_tests: | |
| description: Run post-deployment tests | |
| required: false | |
| default: true | |
| type: boolean | |
| test_level: | |
| description: Test level to run | |
| required: false | |
| default: "quick" | |
| type: choice | |
| options: | |
| - "quick" | |
| - "standard" | |
| - "full" | |
| pull_request: | |
| paths: | |
| - ansible/** | |
| - base-kustomize/** | |
| - base-helm-configs/** | |
| - bin/** | |
| - scripts/** | |
| - ".github/workflows/smoke-deploy-lab.yaml" | |
| env: | |
| HYPERCONVERGED_DEV: "true" | |
| GATEWAY_DOMAIN: cloud.local | |
| ACME_EMAIL: [email protected] | |
| OS_IMAGE: "Ubuntu 24.04" | |
| OS_FLAVOR: gp.5.8.16 | |
| SSH_USERNAME: "ubuntu" | |
| TEST_LEVEL: "quick" | |
| jobs: | |
| smoke-deploy: | |
| runs-on: self-hosted | |
| container: | |
| image: localhost:5000/genestack-ci:latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Dynamically set MY_DATE environment variable | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: echo "LAB_NAME_PREFIX=smoke-$(date +%s)" >> $GITHUB_ENV | |
| - name: Statically set environment variable | |
| if: ${{ github.event_name == 'workflow_dispatch' }} | |
| run: | | |
| echo "LAB_NAME_PREFIX=$(echo '${{ github.event.inputs.gatewayDomain }}' | tr '.' '-')" >> $GITHUB_ENV | |
| echo "GATEWAY_DOMAIN=${{ github.event.inputs.gatewayDomain }}" >> $GITHUB_ENV | |
| echo "ACME_EMAIL=${{ github.event.inputs.acmeEmail }}" >> $GITHUB_ENV | |
| echo "OS_IMAGE=${{ github.event.inputs.osImage }}" >> $GITHUB_ENV | |
| echo "SSH_USERNAME=${{ github.event.inputs.sshUsername }}" >> $GITHUB_ENV | |
| - name: Run deployment script | |
| if: ${{ github.event_name == 'pull_request' || contains(fromJSON('["deploy", "test"]'), github.event.inputs.mode) }} | |
| run: | | |
| eval "$(ssh-agent -s)" | |
| export TEST_LEVEL="${{ github.event.inputs.test_level }}" | |
| scripts/hyperconverged-lab.sh kubespray | |
| - name: Retrieve Keys | |
| if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'deploy' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ssh-keys | |
| if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn` | |
| path: "/github/home/.ssh/${{ env.LAB_NAME_PREFIX }}-key.pem" | |
| - name: Create output file in markdown format | |
| run: | | |
| if [ -s /tmp/output.txt ]; then | |
| echo "### Cloud Access" > access-output.txt | |
| cat /tmp/output.txt >> access-output.txt | |
| fi | |
| - name: Publish Output to Summary | |
| run: | | |
| if [ -s access-output.txt ]; then | |
| { | |
| cat access-output.txt | |
| } >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Upload Test Results | |
| if: ${{ always() && (github.event_name == 'pull_request' || (github.event.inputs.run_tests == 'true' && contains(fromJSON('["deploy", "test"]'), github.event.inputs.mode))) }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ github.run_number }} | |
| path: test-results/ | |
| if-no-files-found: ignore | |
| retention-days: 30 | |
| - name: Publish Test Summary | |
| if: ${{ always() && (github.event_name == 'pull_request' || (github.event.inputs.run_tests == 'true' && contains(fromJSON('["deploy", "test"]'), github.event.inputs.mode))) }} | |
| run: | | |
| echo "## Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| if [ -f test-results/aggregate-results.txt ]; then | |
| echo "### Test Suite Summary" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Test Suite | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|------------|--------|" >> $GITHUB_STEP_SUMMARY | |
| while IFS=: read -r suite status; do | |
| status=$(echo "$status" | xargs) | |
| if [ "$status" = "PASSED" ]; then | |
| echo "| $suite | :white_check_mark: PASSED |" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "| $suite | :x: FAILED |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done < test-results/aggregate-results.txt | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| # Parse XML results if available | |
| if ls test-results/*.xml >/dev/null 2>&1; then | |
| echo "### Detailed Test Results" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| for xml_file in test-results/*.xml; do | |
| if [ -f "$xml_file" ]; then | |
| suite_name=$(grep -o 'name="[^"]*"' "$xml_file" | head -1 | sed 's/name="//;s/"//') | |
| echo "#### $suite_name" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "| Test | Status |" >> $GITHUB_STEP_SUMMARY | |
| echo "|------|--------|" >> $GITHUB_STEP_SUMMARY | |
| grep -o '<testcase name="[^"]*"' "$xml_file" | sed 's/<testcase name="//;s/"$//' | while read test; do | |
| if grep -q "name=\"${test}\".*<failure" "$xml_file"; then | |
| echo "| $test | :x: Failed |" >> $GITHUB_STEP_SUMMARY | |
| elif grep -q "name=\"${test}\".*<skipped" "$xml_file"; then | |
| echo "| $test | :warning: Skipped |" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "| $test | :white_check_mark: Passed |" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| done | |
| fi | |
| if [ ! -f test-results/aggregate-results.txt ] && ! ls test-results/*.xml >/dev/null 2>&1; then | |
| echo "_No test results available_" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| - name: Cleanup the lab | |
| if: ${{ always() && (github.event_name == 'pull_request' || contains(fromJSON('["cleanup", "test"]'), github.event.inputs.mode)) }} | |
| run: scripts/hyperconverged-lab-uninstall.sh kubespray |