mirror of
https://github.com/replicatedhq/troubleshoot.git
synced 2026-02-14 18:29:53 +00:00
separated build and test actions for relevant tests
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: build-test
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -78,22 +78,7 @@ jobs:
|
|||||||
make vet
|
make vet
|
||||||
|
|
||||||
# Unit and integration tests
|
# Unit and integration tests
|
||||||
test:
|
# (moved to push-full-tests.yml)
|
||||||
if: github.event_name == 'push' && needs.changes.outputs.go-files == 'true'
|
|
||||||
needs: [changes, lint]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 20
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
- uses: ./.github/actions/setup-go
|
|
||||||
|
|
||||||
- name: Setup K3s
|
|
||||||
uses: replicatedhq/action-k3s@main
|
|
||||||
with:
|
|
||||||
version: v1.31.2-k3s1
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: make test-integration
|
|
||||||
|
|
||||||
# Build binaries
|
# Build binaries
|
||||||
build:
|
build:
|
||||||
@@ -124,64 +109,26 @@ jobs:
|
|||||||
path: bin/
|
path: bin/
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
# E2E tests
|
# (moved to push-full-tests.yml)
|
||||||
e2e:
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
needs: [changes, build]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 15
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- name: preflight
|
|
||||||
target: preflight-e2e-test
|
|
||||||
needs-k3s: true
|
|
||||||
- name: support-bundle-shell
|
|
||||||
target: support-bundle-e2e-test
|
|
||||||
needs-k3s: true
|
|
||||||
- name: support-bundle-go
|
|
||||||
target: support-bundle-e2e-go-test
|
|
||||||
needs-k3s: false
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Setup K3s
|
|
||||||
if: matrix.needs-k3s
|
|
||||||
uses: replicatedhq/action-k3s@main
|
|
||||||
with:
|
|
||||||
version: v1.31.2-k3s1
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
name: binaries
|
|
||||||
path: bin/
|
|
||||||
|
|
||||||
- run: chmod +x bin/*
|
|
||||||
- run: make ${{ matrix.target }}
|
|
||||||
|
|
||||||
# Success summary
|
# Success summary
|
||||||
success:
|
success:
|
||||||
if: always()
|
if: always()
|
||||||
needs: [lint, test, build, e2e]
|
needs: [lint, build]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check results
|
- name: Check results
|
||||||
run: |
|
run: |
|
||||||
# Check if any required jobs failed
|
# Check if any required jobs failed
|
||||||
if [[ "${{ needs.lint.result }}" == "failure" ]] || \
|
if [[ "${{ needs.lint.result }}" == "failure" ]] || \
|
||||||
[[ "${{ needs.test.result }}" == "failure" ]] || \
|
[[ "${{ needs.build.result }}" == "failure" ]]; then
|
||||||
[[ "${{ needs.build.result }}" == "failure" ]] || \
|
|
||||||
[[ "${{ needs.e2e.result }}" == "failure" ]]; then
|
|
||||||
echo "::error::Some jobs failed or were cancelled"
|
echo "::error::Some jobs failed or were cancelled"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if any required jobs were cancelled
|
# Check if any required jobs were cancelled
|
||||||
if [[ "${{ needs.lint.result }}" == "cancelled" ]] || \
|
if [[ "${{ needs.lint.result }}" == "cancelled" ]] || \
|
||||||
[[ "${{ needs.test.result }}" == "cancelled" ]] || \
|
[[ "${{ needs.build.result }}" == "cancelled" ]]; then
|
||||||
[[ "${{ needs.build.result }}" == "cancelled" ]] || \
|
|
||||||
[[ "${{ needs.e2e.result }}" == "cancelled" ]]; then
|
|
||||||
echo "::error::Some jobs failed or were cancelled"
|
echo "::error::Some jobs failed or were cancelled"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
47
.github/workflows/push-full-tests.yml
vendored
Normal file
47
.github/workflows/push-full-tests.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: push-full-tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
unit-integration:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 20
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- uses: ./.github/actions/setup-go
|
||||||
|
- name: Setup K3s
|
||||||
|
uses: replicatedhq/action-k3s@main
|
||||||
|
with:
|
||||||
|
version: v1.31.2-k3s1
|
||||||
|
- name: Run tests
|
||||||
|
run: make test-integration
|
||||||
|
|
||||||
|
e2e:
|
||||||
|
needs: unit-integration
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 15
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- name: preflight
|
||||||
|
target: preflight-e2e-test
|
||||||
|
needs-k3s: true
|
||||||
|
- name: support-bundle-shell
|
||||||
|
target: support-bundle-e2e-test
|
||||||
|
needs-k3s: true
|
||||||
|
- name: support-bundle-go
|
||||||
|
target: support-bundle-e2e-go-test
|
||||||
|
needs-k3s: false
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
- name: Setup K3s
|
||||||
|
if: matrix.needs-k3s
|
||||||
|
uses: replicatedhq/action-k3s@main
|
||||||
|
with:
|
||||||
|
version: v1.31.2-k3s1
|
||||||
|
- run: make ${{ matrix.target }}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user