1- name : go build
1+ name : build and test
22on :
33 pull_request :
44 branches :
@@ -10,14 +10,64 @@ jobs:
1010 steps :
1111 - name : Check out code
1212 uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
1315 - name : Set up Go
1416 uses : actions/setup-go@v5
1517 with :
1618 go-version-file : ' go.mod'
17- id : go
18- - name : Get dependencies
19- run : |
20- go get -v -t -d ./...
19+ - name : Verify dependencies
20+ run : go mod verify
2121 - name : Build
22+ run : make build
23+ - name : Upload binary
24+ uses : actions/upload-artifact@v4
25+ with :
26+ name : dataplaneapi
27+ path : build/dataplaneapi
28+ retention-days : 1
29+ test :
30+ name : Unit tests
31+ runs-on : ubuntu-latest
32+ steps :
33+ - name : Check out code
34+ uses : actions/checkout@v4
35+ - name : Set up Go
36+ uses : actions/setup-go@v5
37+ with :
38+ go-version-file : ' go.mod'
39+ - name : Test
40+ run : make test
41+ e2e :
42+ name : HAProxy ${{ matrix.haproxy_version }} (${{ matrix.testpart }})
43+ needs : build
44+ strategy :
45+ matrix :
46+ haproxy_version : ["3.4"]
47+ testpart : ["1/4", "2/4", "3/4", "4/4"]
48+ runs-on : ubuntu-latest
49+ steps :
50+ - name : Check out code
51+ uses : actions/checkout@v4
52+ - name : Install Bats
53+ run : |
54+ git clone --depth 1 --branch v1.10.0 https://github.com/bats-core/bats-core.git "$RUNNER_TEMP/bats-core"
55+ sudo "$RUNNER_TEMP/bats-core/install.sh" /usr/local
56+ - name : Download binary
57+ uses : actions/download-artifact@v4
58+ with :
59+ name : dataplaneapi
60+ path : build
61+ - name : Run E2E tests
2262 run : |
23- go build -v .
63+ chmod +x build/dataplaneapi
64+ bash ./e2e/run.bash
65+ env :
66+ HAPROXY_VERSION : ${{ matrix.haproxy_version }}
67+ TESTPART : ${{ matrix.testpart }}
68+ - name : Upload failure logs
69+ if : failure()
70+ uses : actions/upload-artifact@v4
71+ with :
72+ name : e2e-logs-${{ strategy.job-index }}
73+ path : e2e/logs/
0 commit comments