mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-09-03 00:47:17 +00:00
* chore(deps): update Go dependencies for top-level and helm-template example * ci: re-trigger preflight e2e after timeout * ci: add compile-preflight dependency for validate-supportbundle-e2e-go --------- Co-authored-by: ElasticClaw <elasticclaw@replicated.com>
177 lines
4.8 KiB
YAML
177 lines
4.8 KiB
YAML
name: build-test-deploy
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
branches:
|
|
- main
|
|
push:
|
|
branches:
|
|
- "main"
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
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
|
|
|
|
tidy-check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- run: make tidy-diff
|
|
|
|
test-integration:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
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@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- run: make generate preflight
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: preflight
|
|
path: bin/preflight
|
|
|
|
validate-preflight-e2e:
|
|
runs-on: ubuntu-latest
|
|
needs: compile-preflight
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: replicatedhq/action-k3s@main
|
|
id: k3s
|
|
with:
|
|
version: v1.31.2-k3s1
|
|
- name: Download preflight binary
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: preflight
|
|
path: bin/
|
|
- run: chmod +x bin/preflight
|
|
- run: make preflight-e2e-test
|
|
|
|
compile-supportbundle:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- run: make generate support-bundle
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: support-bundle
|
|
path: bin/support-bundle
|
|
|
|
compile-collect:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/setup-go@v7
|
|
with:
|
|
go-version-file: 'go.mod'
|
|
- run: make generate collect
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: collect
|
|
path: bin/collect
|
|
|
|
validate-supportbundle-e2e:
|
|
runs-on: ubuntu-latest
|
|
needs: compile-supportbundle
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: replicatedhq/action-k3s@main
|
|
id: k3s
|
|
with:
|
|
version: v1.31.2-k3s1
|
|
- name: Download support bundle binary
|
|
uses: actions/download-artifact@v8
|
|
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, compile-collect, compile-preflight]
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Download support bundle binary
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: support-bundle
|
|
path: bin/
|
|
- run: chmod +x bin/support-bundle
|
|
- name: Download preflight binary
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
name: preflight
|
|
path: bin/
|
|
- run: chmod +x bin/preflight
|
|
- run: make support-bundle-e2e-go-test
|
|
|
|
# summary jobs, these jobs will only run if all the other jobs have succeeded
|
|
validate-pr-tests:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- tidy-check
|
|
- test-integration
|
|
- validate-preflight-e2e
|
|
- validate-supportbundle-e2e
|
|
- validate-supportbundle-e2e-go
|
|
steps:
|
|
- run: echo "All PR tests passed"
|
|
|
|
|
|
# this job will validate that the validation did not fail and that all pr-tests succeed
|
|
# it is used for the github branch protection rule
|
|
validate-success:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- validate-pr-tests
|
|
if: always()
|
|
steps:
|
|
# https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
|
|
# if the validate-pr-tests job was not successful, this job will fail
|
|
- name: fail if validate-pr-tests job was not successful
|
|
if: needs.validate-pr-tests.result != 'success'
|
|
run: exit 1
|
|
# if the validate-pr-tests job was successful, this job will succeed
|
|
- name: succeed if validate-pr-tests job succeeded
|
|
if: needs.validate-pr-tests.result == 'success'
|
|
run: echo "Validation succeeded"
|