Skip to content

Commit f785577

Browse files
committed
Migrate Backend tests to a GHA workflow
Signed-off-by: ddalvi <ddalvi@redhat.com>
1 parent 24424ba commit f785577

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: KFP Backend Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
paths:
11+
- 'backend/**'
12+
- 'test/presubmit-backend-test.sh'
13+
workflow_dispatch:
14+
15+
jobs:
16+
backend-tests:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
23+
- name: Set up Go
24+
uses: actions/setup-go@v3
25+
with:
26+
go-version: '1.21'
27+
28+
- name: Run Backend Tests
29+
run: ./test/presubmit-backend-test.sh

test/presubmit-backend-test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ set -ex
1919

2020
# Add installed go binaries to PATH.
2121
export PATH="${PATH}:$(go env GOPATH)/bin"
22-
# The current directory is /home/prow/go/src/github.com/kubeflow/pipelines
23-
cd /home/prow/go/src/github.com/kubeflow/pipelines
22+
2423
# 1. Check go modules are tidy
2524
# Reference: https://github.com/golang/go/issues/27005#issuecomment-564892876
2625
go mod download
2726
go mod tidy
2827
git diff --exit-code -- go.mod go.sum || (echo "go modules are not tidy, run 'go mod tidy'." && exit 1)
29-
# 2. run test in project directory
28+
29+
# 2. Run tests in the backend directory
3030
go test -v -cover ./backend/...
31+
3132
# 3. Check for forbidden go licenses
3233
./hack/install-go-licenses.sh
3334
go-licenses check ./backend/src/apiserver ./backend/src/cache ./backend/src/agent/persistence ./backend/src/crd/controller/scheduledworkflow ./backend/src/crd/controller/viewer
34-

0 commit comments

Comments
 (0)