1616 - name : Set up Go
1717 uses : actions/setup-go@v5
1818 with :
19- go-version : 1.22
19+ go-version-file : go.mod
20+ cache-dependency-path : go.sum
2021
2122 - name : Test
2223 run : make test
2930 - name : Set up Go
3031 uses : actions/setup-go@v5
3132 with :
32- go-version : 1.22
33+ go-version-file : go.mod
34+ cache-dependency-path : go.sum
3335
3436 - name : Build
3537 run : make build
4648 - name : Validate Cluster End State
4749 run : ./testing/validate.sh
4850
51+ integration-test-presync :
52+ runs-on : ubuntu-latest
53+ steps :
54+ - uses : actions/checkout@v4
55+
56+ - name : Set up Go
57+ uses : actions/setup-go@v5
58+ with :
59+ go-version-file : go.mod
60+ cache-dependency-path : go.sum
61+
62+ - name : Build
63+ run : make build
64+
65+ - name : Create k8s Kind Cluster
66+ uses : helm/kind-action@v1.10.0
67+
68+ - name : Create Testdata in Cluster
69+ run : ./testing/init.sh
70+
71+ - name : Run PVMigrate
72+ run : ./bin/pvmigrate --source-sc int-source --dest-sc int-dest --pre-sync-mode
73+
74+ - name : Validate Cluster End State
75+ run : ./testing/validate.sh
76+
4977 integration-test-incluster :
5078 runs-on : ubuntu-latest
5179 steps :
5482 - name : Set up Go
5583 uses : actions/setup-go@v5
5684 with :
57- go-version : 1.22
85+ go-version-file : go.mod
86+ cache-dependency-path : go.sum
5887
5988 - name : Build and push
6089 uses : docker/build-push-action@v6
@@ -74,3 +103,31 @@ jobs:
74103
75104 - name : Validate Cluster End State
76105 run : ./testing/validate.sh
106+
107+ # this job will validate that all the tests passed
108+ # it is used for the github branch protection rule
109+ validate-success :
110+ name : Validate success
111+ runs-on : ubuntu-24.04
112+ needs :
113+ - unit-test
114+ - integration-test
115+ - integration-test-presync
116+ - integration-test-incluster
117+ if : always()
118+ steps :
119+ # https://docs.github.com/en/actions/learn-github-actions/contexts#needs-context
120+ - name : fail if unit-test job was not successful
121+ if : needs.unit-test.result != 'success'
122+ run : exit 1
123+ - name : fail if integration-test job was not successful
124+ if : needs.integration-test.result != 'success'
125+ run : exit 1
126+ - name : fail if integration-test-presync job was not successful
127+ if : needs.integration-test-presync.result != 'success'
128+ run : exit 1
129+ - name : fail if integration-test-incluster job was not successful
130+ if : needs.integration-test-incluster.result != 'success'
131+ run : exit 1
132+ - name : succeed if everything else passed
133+ run : echo "Validation succeeded"
0 commit comments