diff --git a/.github/workflows/test-conformance-shared.yaml b/.github/workflows/test-conformance-shared.yaml new file mode 100644 index 00000000..02ac072e --- /dev/null +++ b/.github/workflows/test-conformance-shared.yaml @@ -0,0 +1,155 @@ +name: Conformance Tests - Shared Mode + +on: + schedule: + - cron: "0 1 * * *" + workflow_dispatch: + +permissions: + contents: read + +jobs: + conformance: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + type: + - parallel + - serial + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Install helm + uses: azure/setup-helm@v4.3.0 + + - name: Install hydrophone + run: go install sigs.k8s.io/hydrophone@latest + + - name: Install k3d and kubectl + run: | + wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash + k3d version + + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + + - name: Setup Kubernetes (k3d) + env: + REPO_NAME: k3k-registry + REPO_PORT: 12345 + run: | + echo "127.0.0.1 ${REPO_NAME}" | sudo tee -a /etc/hosts + + k3d registry create ${REPO_NAME} --port ${REPO_PORT} + + k3d cluster create k3k --servers 2 \ + -p "30000-30010:30000-30010@server:0" \ + --registry-use k3d-${REPO_NAME}:${REPO_PORT} + + kubectl cluster-info + kubectl get nodes + + - name: Setup K3k + env: + REPO: k3k-registry:12345 + run: | + echo "127.0.0.1 k3k-registry" | sudo tee -a /etc/hosts + + make build + make package + make push + + # add k3kcli to $PATH + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + + VERSION=$(make version) + k3d image import ${REPO}/k3k:${VERSION} -c k3k --verbose + k3d image import ${REPO}/k3k-kubelet:${VERSION} -c k3k --verbose + + make install + + echo "Wait for K3k controller to be available" + kubectl wait -n k3k-system pod --for condition=Ready -l "app.kubernetes.io/name=k3k" --timeout=5m + + - name: Check k3kcli + run: k3kcli -v + + - name: Create virtual cluster + run: | + kubectl create namespace k3k-mycluster + + cat <> $GITHUB_STEP_SUMMARY + echo '| Passed | Failed | Pending | Skipped |' >> $GITHUB_STEP_SUMMARY + echo '|---|---|---|---|' >> $GITHUB_STEP_SUMMARY + + RESULTS=$(tail -10 /tmp/e2e.log | grep -E "Passed .* Failed .* Pending .* Skipped" | cut -d '-' -f 3) + RESULTS=$(echo $RESULTS | grep -oE '[0-9]+' | xargs | sed 's/ / | /g') + echo "| $RESULTS |" >> $GITHUB_STEP_SUMMARY + + echo '' >> $GITHUB_STEP_SUMMARY + echo '### Failed Tests' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + grep '\[FAIL\]' /tmp/e2e.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/test-conformance-virtual.yaml b/.github/workflows/test-conformance-virtual.yaml index 0cfc3173..29f88fdc 100644 --- a/.github/workflows/test-conformance-virtual.yaml +++ b/.github/workflows/test-conformance-virtual.yaml @@ -123,3 +123,20 @@ jobs: with: name: conformance-${{ matrix.type }}-logs path: /tmp/e2e.log + + - name: Job Summary + if: always() + run: | + echo '## 📊 Conformance Tests Results (${{ matrix.type }})' >> $GITHUB_STEP_SUMMARY + echo '| Passed | Failed | Pending | Skipped |' >> $GITHUB_STEP_SUMMARY + echo '|---|---|---|---|' >> $GITHUB_STEP_SUMMARY + + RESULTS=$(tail -10 /tmp/e2e.log | grep -E "Passed .* Failed .* Pending .* Skipped" | cut -d '-' -f 3) + RESULTS=$(echo $RESULTS | grep -oE '[0-9]+' | xargs | sed 's/ / | /g') + echo "| $RESULTS |" >> $GITHUB_STEP_SUMMARY + + echo '' >> $GITHUB_STEP_SUMMARY + echo '### Failed Tests' >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY + grep '\[FAIL\]' /tmp/e2e.log >> $GITHUB_STEP_SUMMARY + echo '```' >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/test-conformance.yaml b/.github/workflows/test-conformance.yaml deleted file mode 100644 index 5defb549..00000000 --- a/.github/workflows/test-conformance.yaml +++ /dev/null @@ -1,302 +0,0 @@ -name: Conformance Tests - -on: - schedule: - - cron: "0 1 * * *" - workflow_dispatch: - inputs: - test: - description: "Run specific test" - type: choice - options: - - conformance - - sig-api-machinery - - sig-apps - - sig-architecture - - sig-auth - - sig-cli - - sig-instrumentation - - sig-network - - sig-node - - sig-scheduling - - sig-storage - -permissions: - contents: read - -jobs: - conformance: - runs-on: ubuntu-latest - if: inputs.test == '' || inputs.test == 'conformance' - - strategy: - fail-fast: false - matrix: - type: - - parallel - - serial - - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: 0 - fetch-tags: true - - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - - - name: Install helm - uses: azure/setup-helm@v4.3.0 - - - name: Install hydrophone - run: go install sigs.k8s.io/hydrophone@latest - - - name: Install k3d and kubectl - run: | - wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash - k3d version - - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - - - name: Setup Kubernetes (k3d) - env: - REPO_NAME: k3k-registry - REPO_PORT: 12345 - run: | - echo "127.0.0.1 ${REPO_NAME}" | sudo tee -a /etc/hosts - - k3d registry create ${REPO_NAME} --port ${REPO_PORT} - - k3d cluster create k3k --servers 3 \ - -p "30000-30010:30000-30010@server:0" \ - --registry-use k3d-${REPO_NAME}:${REPO_PORT} - - kubectl cluster-info - kubectl get nodes - - - name: Setup K3k - env: - REPO: k3k-registry:12345 - run: | - echo "127.0.0.1 k3k-registry" | sudo tee -a /etc/hosts - - make build - make package - make push - - # add k3kcli to $PATH - echo "${{ github.workspace }}/bin" >> $GITHUB_PATH - - VERSION=$(make version) - k3d image import ${REPO}/k3k:${VERSION} -c k3k --verbose - k3d image import ${REPO}/k3k-kubelet:${VERSION} -c k3k --verbose - - make install - - echo "Wait for K3k controller to be available" - kubectl wait -n k3k-system pod --for condition=Ready -l "app.kubernetes.io/name=k3k" --timeout=5m - - - name: Check k3kcli - run: k3kcli -v - - - name: Create virtual cluster - run: | - kubectl create namespace k3k-mycluster - - cat <> $GITHUB_PATH - - VERSION=$(make version) - k3d image import ${REPO}/k3k:${VERSION} -c k3k --verbose - k3d image import ${REPO}/k3k-kubelet:${VERSION} -c k3k --verbose - - make install - - echo "Wait for K3k controller to be available" - kubectl wait -n k3k-system pod --for condition=Ready -l "app.kubernetes.io/name=k3k" --timeout=5m - - - name: Check k3kcli - run: k3kcli -v - - - name: Create virtual cluster - run: | - kubectl create namespace k3k-mycluster - - cat <