fix: Go code quality improvements #1001
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-24.04 | |
| needs: [build] | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Free Disk Space | |
| uses: jlumbroso/free-disk-space@main | |
| - name: Install k3s | |
| run: | | |
| curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE=777 INSTALL_K3S_EXEC="server --docker --kubelet-arg=image-gc-high-threshold=85 --kubelet-arg=image-gc-low-threshold=80" sudo sh - | |
| mkdir -p ~/.kube | |
| sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config | |
| sudo chown $USER ~/.kube/config | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: e2e | |
| # Do it before the browsers and dependencies get installed, because it takes long. | |
| - name: Generate K8 files | |
| run: | | |
| version="$(bash .github/workflows/determine_docker_image_tag.sh)" | |
| export MINIO_ROOT_USER="minioadmin" | |
| export MINIO_ROOT_PASSWORD=$(openssl rand -base64 32) | |
| bash k8/generate.sh $version | |
| env: | |
| WORKER_COUNT: 1 | |
| - name: Deploy to k3s | |
| run: kubectl apply -f k8/ | |
| - name: Install Playwright | |
| run: npx playwright install --with-deps | |
| working-directory: e2e | |
| - name: Run e2e tests | |
| working-directory: e2e | |
| run: | | |
| kubectl wait --timeout 10m --for=condition=ready pods --all | |
| FRONTEND_PORT=$(kubectl get svc frontend -o=jsonpath='{.spec.ports[0].nodePort}') | |
| FRONTEND_URL="http://127.0.0.1:$FRONTEND_PORT" | |
| echo "Host: $FRONTEND_URL" | |
| npx wait-on --timeout 120000 "$FRONTEND_URL/service/control/health" | |
| kubectl wait --timeout 3m --for=condition=ready pod -l role=worker | |
| ROOT_TEST_URL=$FRONTEND_URL npm run test | |
| env: | |
| FLAKINESS_ACCESS_TOKEN: ${{ secrets.FLAKINESS_ACCESS_TOKEN }} | |
| - name: Debug on failure | |
| if: failure() | |
| run: | | |
| echo "=== Pod Status ===" | |
| kubectl get pods -o wide | |
| echo "" | |
| echo "=== Control Service Logs ===" | |
| kubectl logs deploy/control --tail=200 || true | |
| echo "" | |
| echo "=== Control Service Previous Logs (crashed) ===" | |
| kubectl logs deploy/control --previous --tail=200 || true | |
| echo "" | |
| echo "=== Control Service Describe ===" | |
| kubectl describe pod -l io.kompose.service=control || true | |
| echo "" | |
| echo "=== RabbitMQ Logs ===" | |
| kubectl logs deploy/rabbitmq --tail=50 || true | |
| echo "" | |
| echo "=== etcd Logs ===" | |
| kubectl logs deploy/etcd --tail=50 || true | |
| echo "" | |
| echo "=== File Service Logs ===" | |
| kubectl logs deploy/file --tail=100 || true | |
| - name: Upload playwright-report | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-playwright-report | |
| path: e2e/playwright-report/ | |
| build: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| directory: | |
| - worker-javascript | |
| - worker-java | |
| - worker-python | |
| - worker-csharp | |
| - file-service | |
| - frontend | |
| - control-service | |
| - squid | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build image | |
| run: docker build . --file ${{ matrix.directory }}/Dockerfile --tag local-image | |
| - name: Login to GitHub Package Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Push image | |
| run: | | |
| IMAGE_ID=ghcr.io/${{ github.repository }}/${{ matrix.directory }} | |
| DOCKER_IMAGE_TAG="$(bash .github/workflows/determine_docker_image_tag.sh)" | |
| DOCKER_IMAGE="$IMAGE_ID:$DOCKER_IMAGE_TAG" | |
| echo "Docker image: $DOCKER_IMAGE" | |
| docker tag local-image $DOCKER_IMAGE | |
| docker push $DOCKER_IMAGE |