From 35e07e5d86b8248592d72feee06efec1d57714e9 Mon Sep 17 00:00:00 2001 From: Alexis Couvreur Date: Fri, 28 Jun 2024 10:04:04 -0400 Subject: [PATCH] Add E2E tests --- .github/workflows/plugins.yml | 138 +++++++++++++++++++++++++++++++--- 1 file changed, 128 insertions(+), 10 deletions(-) diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 24c4608b..a5a77266 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -218,19 +218,137 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Build + run: make proxywasm + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: proxywasm-plugin-wasm + path: ./plugins/proxywasm/sablierproxywasm.wasm + + proxywasm_apisix_e2e: + name: Run Sablier E2E tests for Proxywasm middleware on Apache APISIX + runs-on: ubuntu-latest + needs: + - build + - build-proxywasm + strategy: + fail-fast: false + matrix: + provider: [ docker ] #, docker_swarm, kubernetes] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go 1.22 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + cache-dependency-path: | + go.sum + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Build and push - uses: docker/build-push-action@v6 + - name: Download artifact + uses: actions/download-artifact@v4 with: - context: plugins/caddy - file: plugins/caddy/Dockerfile - tags: caddy:local - outputs: type=docker,dest=/tmp/caddy.tar + name: sablier-image-tar + path: /tmp - - name: Upload artifact - uses: actions/upload-artifact@v4 + - name: Load Docker image + run: docker load --input /tmp/sablier.tar + + - name: Download Proxywasm artifact + uses: actions/download-artifact@v4 with: - name: caddy-image-tar - path: /tmp/caddy.tar \ No newline at end of file + name: proxywasm-plugin-wasm + path: ./plugins/proxywasm + + - name: Test ${{ matrix.provider }} + run: cd plugins/proxywasm/e2e/apacheapisix/${{ matrix.provider }} && bash ./run.sh + + proxywasm_envoy_e2e: + name: Run Sablier E2E tests for Proxywasm middleware on Envoy + runs-on: ubuntu-latest + needs: + - build + - build-proxywasm + strategy: + fail-fast: false + matrix: + provider: [ docker ] #, docker_swarm, kubernetes] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go 1.22 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + cache-dependency-path: | + go.sum + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: sablier-image-tar + path: /tmp + + - name: Load Docker image + run: docker load --input /tmp/sablier.tar + + - name: Download Proxywasm artifact + uses: actions/download-artifact@v4 + with: + name: proxywasm-plugin-wasm + path: ./plugins/proxywasm + + - name: Test ${{ matrix.provider }} + run: cd plugins/proxywasm/e2e/envoy/${{ matrix.provider }} && bash ./run.sh + + proxywasm_nginx_e2e: + name: Run Sablier E2E tests for Proxywasm middleware on Nginx + runs-on: ubuntu-latest + needs: + - build + - build-proxywasm + strategy: + fail-fast: false + matrix: + provider: [ docker ] #, docker_swarm, kubernetes] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go 1.22 + uses: actions/setup-go@v5 + with: + go-version: 1.22 + cache-dependency-path: | + go.sum + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: sablier-image-tar + path: /tmp + + - name: Load Docker image + run: docker load --input /tmp/sablier.tar + + - name: Download Proxywasm artifact + uses: actions/download-artifact@v4 + with: + name: proxywasm-plugin-wasm + path: ./plugins/proxywasm + + - name: Test ${{ matrix.provider }} + run: cd plugins/proxywasm/e2e/nginx/${{ matrix.provider }} && bash ./run.sh