Skip to content

Commit 2d664b8

Browse files
committed
separated build and test actions for relevant tests
1 parent 8762bd1 commit 2d664b8

File tree

2 files changed

+53
-59
lines changed

2 files changed

+53
-59
lines changed

.github/workflows/build-test.yaml renamed to .github/workflows/build.yaml

Lines changed: 6 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: build-test
1+
name: build
22

33
on:
44
pull_request:
@@ -78,22 +78,7 @@ jobs:
7878
make vet
7979
8080
# Unit and integration tests
81-
test:
82-
if: github.event_name == 'push' && needs.changes.outputs.go-files == 'true'
83-
needs: [changes, lint]
84-
runs-on: ubuntu-latest
85-
timeout-minutes: 20
86-
steps:
87-
- uses: actions/checkout@v5
88-
- uses: ./.github/actions/setup-go
89-
90-
- name: Setup K3s
91-
uses: replicatedhq/action-k3s@main
92-
with:
93-
version: v1.31.2-k3s1
94-
95-
- name: Run tests
96-
run: make test-integration
81+
# (moved to push-full-tests.yml)
9782

9883
# Build binaries
9984
build:
@@ -124,64 +109,26 @@ jobs:
124109
path: bin/
125110
retention-days: 1
126111

127-
# E2E tests
128-
e2e:
129-
if: github.event_name == 'push'
130-
needs: [changes, build]
131-
runs-on: ubuntu-latest
132-
timeout-minutes: 15
133-
strategy:
134-
fail-fast: false
135-
matrix:
136-
include:
137-
- name: preflight
138-
target: preflight-e2e-test
139-
needs-k3s: true
140-
- name: support-bundle-shell
141-
target: support-bundle-e2e-test
142-
needs-k3s: true
143-
- name: support-bundle-go
144-
target: support-bundle-e2e-go-test
145-
needs-k3s: false
146-
steps:
147-
- uses: actions/checkout@v5
148-
149-
- name: Setup K3s
150-
if: matrix.needs-k3s
151-
uses: replicatedhq/action-k3s@main
152-
with:
153-
version: v1.31.2-k3s1
154-
155-
- uses: actions/download-artifact@v4
156-
with:
157-
name: binaries
158-
path: bin/
159-
160-
- run: chmod +x bin/*
161-
- run: make ${{ matrix.target }}
112+
# (moved to push-full-tests.yml)
162113

163114
# Success summary
164115
success:
165116
if: always()
166-
needs: [lint, test, build, e2e]
117+
needs: [lint, build]
167118
runs-on: ubuntu-latest
168119
steps:
169120
- name: Check results
170121
run: |
171122
# Check if any required jobs failed
172123
if [[ "${{ needs.lint.result }}" == "failure" ]] || \
173-
[[ "${{ needs.test.result }}" == "failure" ]] || \
174-
[[ "${{ needs.build.result }}" == "failure" ]] || \
175-
[[ "${{ needs.e2e.result }}" == "failure" ]]; then
124+
[[ "${{ needs.build.result }}" == "failure" ]]; then
176125
echo "::error::Some jobs failed or were cancelled"
177126
exit 1
178127
fi
179128
180129
# Check if any required jobs were cancelled
181130
if [[ "${{ needs.lint.result }}" == "cancelled" ]] || \
182-
[[ "${{ needs.test.result }}" == "cancelled" ]] || \
183-
[[ "${{ needs.build.result }}" == "cancelled" ]] || \
184-
[[ "${{ needs.e2e.result }}" == "cancelled" ]]; then
131+
[[ "${{ needs.build.result }}" == "cancelled" ]]; then
185132
echo "::error::Some jobs failed or were cancelled"
186133
exit 1
187134
fi
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: push-full-tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
unit-integration:
9+
runs-on: ubuntu-latest
10+
timeout-minutes: 20
11+
steps:
12+
- uses: actions/checkout@v5
13+
- uses: ./.github/actions/setup-go
14+
- name: Setup K3s
15+
uses: replicatedhq/action-k3s@main
16+
with:
17+
version: v1.31.2-k3s1
18+
- name: Run tests
19+
run: make test-integration
20+
21+
e2e:
22+
needs: unit-integration
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 15
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- name: preflight
30+
target: preflight-e2e-test
31+
needs-k3s: true
32+
- name: support-bundle-shell
33+
target: support-bundle-e2e-test
34+
needs-k3s: true
35+
- name: support-bundle-go
36+
target: support-bundle-e2e-go-test
37+
needs-k3s: false
38+
steps:
39+
- uses: actions/checkout@v5
40+
- name: Setup K3s
41+
if: matrix.needs-k3s
42+
uses: replicatedhq/action-k3s@main
43+
with:
44+
version: v1.31.2-k3s1
45+
- run: make ${{ matrix.target }}
46+
47+

0 commit comments

Comments
 (0)