Add cron job support bundle scheduler #27
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: build-test | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
branches: | ||
- v1beta3 | ||
push: | ||
branches: | ||
- "v1beta3" | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
fail_if_pull_request_is_draft: | ||
if: github.event.pull_request.draft == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Fails in order to indicate that pull request needs to be marked as ready to review and unit tests workflow needs to pass. | ||
run: exit 1 | ||
test-integration: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- uses: actions/setup-go@v6 | ||
with: | ||
go-version-file: 'go.mod' | ||
- uses: replicatedhq/action-k3s@main | ||
id: k3s | ||
with: | ||
version: v1.31.2-k3s1 | ||
# test-integration includes unit tests | ||
- run: make test-integration | ||
compile-preflight: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- uses: actions/setup-go@v6 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: make preflight | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: preflight | ||
path: bin/preflight | ||
validate-preflight-e2e: | ||
runs-on: ubuntu-latest | ||
needs: compile-preflight | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- uses: replicatedhq/action-k3s@main | ||
id: k3s | ||
with: | ||
version: v1.31.2-k3s1 | ||
- name: Download preflight binary | ||
uses: actions/download-artifact@v5 | ||
with: | ||
name: preflight | ||
path: bin/ | ||
- run: chmod +x bin/preflight | ||
- run: make preflight-e2e-test | ||
run-examples: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- run: make run-examples | ||
compile-supportbundle: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- uses: actions/setup-go@v6 | ||
with: | ||
go-version-file: 'go.mod' | ||
- run: make support-bundle | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: support-bundle | ||
path: bin/support-bundle | ||
validate-supportbundle-e2e: | ||
runs-on: ubuntu-latest | ||
needs: compile-supportbundle | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- uses: replicatedhq/action-k3s@main | ||
id: k3s | ||
with: | ||
version: v1.31.2-k3s1 | ||
- name: Download support bundle binary | ||
uses: actions/download-artifact@v5 | ||
with: | ||
name: support-bundle | ||
path: bin/ | ||
- run: chmod +x bin/support-bundle | ||
- run: make support-bundle-e2e-test | ||
# Additional e2e tests for support bundle that run in Go, these create a Kind cluster | ||
validate-supportbundle-e2e-go: | ||
runs-on: ubuntu-latest | ||
needs: compile-supportbundle | ||
steps: | ||
- uses: actions/checkout@v5 | ||
- name: Download support bundle binary | ||
uses: actions/download-artifact@v5 | ||
with: | ||
name: support-bundle | ||
path: bin/ | ||
- run: chmod +x bin/support-bundle | ||
- name: Download preflight binary | ||
uses: actions/download-artifact@v5 | ||
with: | ||
name: preflight | ||
path: bin/ | ||
- run: chmod +x bin/preflight | ||
- run: make support-bundle-e2e-go-test | ||
# Summary job - all tests must pass for this to succeed | ||
validate-success: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- tidy-check | ||
- test-integration | ||
- run-examples | ||
- validate-preflight-e2e | ||
- validate-supportbundle-e2e | ||
- validate-supportbundle-e2e-go | ||
if: always() | ||
steps: | ||
# Check if all required jobs succeeded | ||
- name: fail if any required job failed | ||
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | ||
run: exit 1 | ||
# Success message | ||
- name: All tests passed | ||
run: echo "All build and test jobs completed successfully" |