|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - 'main' |
| 10 | + tags: |
| 11 | + - '*' |
| 12 | + workflow_dispatch: {} |
| 13 | + |
| 14 | +jobs: |
| 15 | + dataplane-tests: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + steps: |
| 18 | + - name: setup golang |
| 19 | + uses: actions/setup-go@v3 |
| 20 | + with: |
| 21 | + go-version: '^1.19' |
| 22 | + |
| 23 | + - name: cache go modules |
| 24 | + uses: actions/cache@v3 |
| 25 | + with: |
| 26 | + path: ~/go/pkg/mod |
| 27 | + key: ${{ runner.os }}-build-codegen-${{ hashFiles('**/go.sum') }} |
| 28 | + restore-keys: | |
| 29 | + ${{ runner.os }}-build-codegen- |
| 30 | +
|
| 31 | + - name: cache image builds |
| 32 | + uses: actions/cache@v3 |
| 33 | + with: |
| 34 | + path: /var/lib/docker/ |
| 35 | + key: ${{ runner.os }}-build-image-cache |
| 36 | + restore-keys: | |
| 37 | + ${{ runner.os }}-build-image-cache- |
| 38 | +
|
| 39 | + - name: checkout repository |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + fetch-depth: 0 |
| 43 | + |
| 44 | + - name: Build Cluster |
| 45 | + run: make build.cluster |
| 46 | + |
| 47 | + - name: Build Dataplane Image |
| 48 | + run: make build.image.dataplane TAG=integration-tests |
| 49 | + |
| 50 | + - name: Load Dataplane Image |
| 51 | + run: make load.image.dataplane |
| 52 | + |
| 53 | + - name: Generate Self-Signed Certs |
| 54 | + run: make test.gencert |
| 55 | + |
| 56 | + - name: Create Dataplane in Cluster |
| 57 | + run: kubectl apply -k config/tests/auth |
| 58 | + |
| 59 | + - name: Waiting for dataplane to be ready |
| 60 | + run: | |
| 61 | + kubectl \ |
| 62 | + -n blixt-system \ |
| 63 | + wait --for=condition=Ready pod \ |
| 64 | + -l app=blixt,component=dataplane \ |
| 65 | + --timeout=120s || |
| 66 | + kubectl -n blixt-system logs -l app=blixt,component=dataplane || |
| 67 | + kubectl -n blixt-system describe pod -l app=blixt,component=dataplane |
| 68 | +
|
| 69 | + - name: Forward gRPC Port |
| 70 | + run: nohup kubectl -n blixt-system port-forward ds/dataplane 9874 & |
| 71 | + |
| 72 | + - name: Dataplane Integration Tests |
| 73 | + run: make test.dataplane.integration |
| 74 | + |
| 75 | + ## Upload diagnostics if integration test step failed. |
| 76 | + - name: upload diagnostics |
| 77 | + if: ${{ failure() }} |
| 78 | + uses: actions/upload-artifact@v3 |
| 79 | + with: |
| 80 | + name: blixt-integration-test-diag |
| 81 | + path: /tmp/ktf-diag* |
| 82 | + if-no-files-found: ignore |
| 83 | + |
0 commit comments