From cc3bb42e49bf420aed3020740427981b816912a9 Mon Sep 17 00:00:00 2001 From: Federico Paolinelli Date: Wed, 28 Jun 2023 17:34:15 +0200 Subject: [PATCH] Add a CI lane with e2e tests Signed-off-by: Federico Paolinelli --- .github/workflows/ci.yaml | 46 +++++++++++++++++++ .../composite/collectlogs/action.yaml | 21 +++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/workflows/composite/collectlogs/action.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5d9f04e1..2ba82e4a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -91,3 +91,49 @@ jobs: retention-days: 1 name: image-tar-frrk8s path: /tmp/frrk8s.tar + e2e: + runs-on: ubuntu-22.04 + needs: + - unit-tests + - build-test-images + - commitlint + strategy: + fail-fast: false + matrix: + ip-family: [ipv4, ipv6, dual] + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install kernel modules + run: | + sudo apt-get update + sudo apt-get install linux-modules-extra-$(uname -r) + + - name: Download frr8ks images + uses: actions/download-artifact@v3 + with: + path: image + + - name: Load image + working-directory: image + run: | + docker load -i image-tar-frrk8s/frrk8s.tar + + - name: E2E + run: | + IP_FAMILY="${{ matrix.ip-family }}" + IP_FAMILY=$IP_FAMILY make kind-cluster + SKIP="none" + if [ "${{ matrix.ip-family }}" == "ipv4" ]; then SKIP="$SKIP|IPV6|DUALSTACK"; fi + if [ "${{ matrix.ip-family }}" == "dual" ]; then SKIP="$SKIP|IPV6"; fi + if [ "${{ matrix.ip-family }}" == "ipv6" ]; then SKIP="$SKIP|IPV4|DUALSTACK"; fi + + make deploy + GINKGO_ARGS="--skip $SKIP" make e2etests + + - name: Collect Logs + if: ${{ failure() }} + uses: ./.github/workflows/composite/collectlogs + with: + artifact-name: kind-logs-${{ matrix.ip-family }} diff --git a/.github/workflows/composite/collectlogs/action.yaml b/.github/workflows/composite/collectlogs/action.yaml new file mode 100644 index 00000000..3b41660a --- /dev/null +++ b/.github/workflows/composite/collectlogs/action.yaml @@ -0,0 +1,21 @@ +name: "collectlogs" +description: "Collect and upload the logs" + +inputs: + artifact-name: + description: "the name of artifacts to store" + required: true + +runs: + using: "composite" + steps: + - name: Log permissions + shell: bash + run: | + sudo chmod -R o+r /tmp/kind_logs + + - name: Upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ inputs.artifact-name }} + path: /tmp/kind_logs/