name: Main CI WorkFlow on: push: branches: - master tags: paths-ignore: - '**.md' - 'docs/**' - '**/OWNERS' - '**/MAINTAINERS' pull_request: paths-ignore: - '**.md' - 'docs/**' - '**/OWNERS' - '**/MAINTAINERS' env: CONTAINER_RUN_OPTIONS: " " GINKGO_VERSION: "v2.9.5" jobs: lint: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Verify vendor, licenses, do lint env: GOPATH: /home/runner/work/${{ github.repository }} steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 path: ./src/github.com/${{ github.repository }} - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | sudo apt-get install -y jq - name: Run verify test run: make verify working-directory: ./src/github.com/${{ github.repository }} - name: Run lint test run: make lint working-directory: ./src/github.com/${{ github.repository }} image-prepare: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Prepare kubeedge/build-tools image steps: - name: Pull kubeedge/build-tools image run: | docker pull kubeedge/build-tools:1.20.10-ke1 mkdir -p /home/runner/build-tools/ docker save kubeedge/build-tools:1.20.10-ke1 > /home/runner/build-tools/build-tools.tar - name: Temporarily save kubeedge/build-tools image uses: actions/upload-artifact@v3 with: name: build-tools-docker-artifact path: /home/runner/build-tools build: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Multiple build needs: image-prepare steps: - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: Retrieve saved kubeedge/build-tools image uses: actions/download-artifact@v3 with: name: build-tools-docker-artifact path: /home/runner/build-tools - name: docker load kubeedge/build-tools image run: | docker load < /home/runner/build-tools/build-tools.tar - run: make - run: make smallbuild - run: make crossbuild - run: make crossbuild ARM_VERSION=GOARM7 - run: make crossbuild WHAT=cloudcore ARM_VERSION=GOARM8 basic_test: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Unit test, integration test edge env: GO111MODULE: on steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - run: make test PROFILE=y - name: Upload coverage to Codecov # Prevent running from the forked repository that doesn't need to upload coverage. # In addition, running on the forked repository would fail as missing the necessary secret. if: ${{ github.repository == 'kubeedge/kubeedge' }} uses: codecov/codecov-action@v4 with: # Even though token upload token is not required for public repos, # but adding a token might increase successful uploads as per: # https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 token: ${{secrets.CODECOV_UPLOAD_TOKEN}} files: ./coverage.out flags: unittests fail_ci_if_error: true verbose: true - name: enable cri config in containerd service run: | containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service - run: make integrationtest e2e_test: runs-on: ubuntu-22.04 strategy: matrix: cases: - protocol: WebSocket version: v1.27.0 - protocol: WebSocket version: v1.26.0 - protocol: WebSocket version: v1.25.0 - protocol: QUIC version: v1.27.0 - protocol: QUIC version: v1.26.0 - protocol: QUIC version: v1.25.0 timeout-minutes: 60 name: E2e test needs: image-prepare env: GO111MODULE: on steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} go install sigs.k8s.io/kind@v0.19.0 curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: cleanup images run: docker system prune -a -f - name: Retrieve saved kubeedge/build-tools image uses: actions/download-artifact@v3 with: name: build-tools-docker-artifact path: /home/runner/build-tools - name: docker load kubeedge/build-tools image run: | docker load < /home/runner/build-tools/build-tools.tar - name: enable cri config in containerd service run: | containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service # for QUIC protocol, we will use docker as edgecore container runtime # for WebSocket protocol, we will use containerd as edgecore container runtime # just for covering both docker and CRI runtime e2e cases - run: | export PROTOCOL=${{ matrix.cases.protocol }} export KIND_IMAGE=kindest/node:${{ matrix.cases.version }} export CONTAINER_RUNTIME="containerd" make e2e - uses: actions/upload-artifact@v3 if: always() with: name: ${{ matrix.cases.version }}-${{ matrix.cases.protocol }}-e2e-test-logs path: | /tmp/cloudcore.log /tmp/edgecore.log keadm_deprecated_e2e_test: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Keadm deprecated e2e test needs: image-prepare env: GO111MODULE: on steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} go install sigs.k8s.io/kind@v0.19.0 curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: cleanup images run: docker system prune -a -f - name: Retrieve saved kubeedge/build-tools image uses: actions/download-artifact@v3 with: name: build-tools-docker-artifact path: /home/runner/build-tools - name: docker load kubeedge/build-tools image run: | docker load < /home/runner/build-tools/build-tools.tar - name: enable cri config in containerd service run: | containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service - run: make keadm_deprecated_e2e keadm_e2e_test: runs-on: ubuntu-22.04 timeout-minutes: 30 name: Keadm e2e test env: GO111MODULE: on steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} go install sigs.k8s.io/kind@v0.19.0 curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: Set up Helm uses: azure/setup-helm@v3 with: version: v3.4.0 - name: enable cri config in containerd service run: | containerd config default | sudo tee /etc/containerd/config.toml && sudo systemctl restart containerd.service - name: cleanup images run: docker system prune -a -f - run: make keadm_e2e docker_build: runs-on: ubuntu-22.04 timeout-minutes: 40 name: Multiple docker image build steps: - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: cleanup images run: docker system prune -a -f - name: make image run: | export DOCKER_BUILD_AND_SYSTEM_PRUNE="true" make image container_runtime_test: runs-on: ubuntu-22.04 strategy: matrix: container-runtime: [ 'isulad', 'cri-o', 'docker' ] name: container runtime e2e test env: GO111MODULE: on steps: - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.20.x - uses: actions/cache@v3 with: path: ~/go/pkg/mod key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/v2/ginkgo@${{ env.GINKGO_VERSION }} go install sigs.k8s.io/kind@v0.19.0 curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.27.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 - name: Run e2e run: make e2e env: CONTAINER_RUNTIME: ${{ matrix.container-runtime }} - uses: actions/upload-artifact@v3 if: always() with: name: ${{ matrix.container-runtime }}-e2e-test-logs path: | /tmp/cloudcore.log /tmp/edgecore.log