Fix/edgemark #25
Workflow file for this run
This file contains 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: 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: "v1.16.4" | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
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.17.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: 120 | |
name: Prepare kubeedge/build-tools image | |
steps: | |
- name: Pull kubeedge/build-tools image | |
run: | | |
docker pull kubeedge/build-tools | |
mkdir -p /home/runner/build-tools/ | |
docker save kubeedge/build-tools > /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: 120 | |
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: 120 | |
name: Unit test, integration test edge | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17.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/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@v3 | |
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 | |
- run: make integrationtest | |
e2e_test: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
PROTOCOL: | |
- WebSocket | |
- QUIC | |
timeout-minutes: 120 | |
name: E2e test | |
needs: image-prepare | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17.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/ginkgo@${{ env.GINKGO_VERSION }} | |
go install sigs.k8s.io/[email protected] | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl | |
- 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 | |
# 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.PROTOCOL }} | |
if [[ ${{ matrix.PROTOCOL }} == "QUIC" ]]; then | |
export CONTAINER_RUNTIME="docker" | |
elif [[ ${{ matrix.PROTOCOL }} == "WebSocket" ]]; then | |
export CONTAINER_RUNTIME="remote" | |
fi | |
make e2e | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: ${{ matrix.PROTOCOL }}-e2e-test-logs | |
path: | | |
/tmp/cloudcore.log | |
/tmp/edgecore.log | |
keadm_deprecated_e2e_test: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
name: Keadm deprecated e2e test | |
needs: image-prepare | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17.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/ginkgo@${{ env.GINKGO_VERSION }} | |
go install sigs.k8s.io/[email protected] | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.15/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl | |
- 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 keadm_deprecated_e2e | |
keadm_e2e_test: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
name: Keadm e2e test | |
env: | |
GO111MODULE: on | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.17.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/ginkgo@${{ env.GINKGO_VERSION }} | |
go install sigs.k8s.io/[email protected] | |
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.23.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 | |
- run: make keadm_e2e | |
docker_build: | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 120 | |
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 | |
- run: make image |