CI Workflow
The current CI Worflow of OpenYurt contains the following checks:
- check-license
- markdownlint-misspell-shellcheck
- unit-tests
- build-binaries
At the moment you submit a pull request to OpenYurt, Github Actions will be triggered to check your PR. A pull request can not be merged until it passed all the checks in Github Actions as the following picture shows:
check-license
will check all the .go
and .sh
files to ensure all of them have a license. It will use the bash shell check_license.sh. If it finds some files don’t contain license, it will output their paths.
license is a statement in the comments at the beginning of the file. The following license is what OpenYurt uses:
golangci-lint
golangci-lint
will check the format of all go source code files. It uses the tool golangci-lint
with serval linters to do the check. More details of golangci-lint
can be found at the doc. This sections will give the brief introduction of linters used by OpenYurt.
You can use make lint
at your local host to run these checks. This command will automatically install the golangci-lint
tool if not found. Running this command at local host will show more details than what Github Actions will output, such as the error lines. We always recommend running at your local host before submitting a pull reuqest.
OpenYurt uses the to do this check, which contains some installed lint tools we need: misspell and . misspell will check if there’re some misspelled English words. It will output the file path and line number, if any. markdownlint will check if markdown files repect specified rules. The descriptions of all rules can be found at the doc. In this check, MD010
, MD013
, MD022
, MD024
, MD029
, MD031
, MD032
, MD033
, MD034
, will not be respected.
unit-tests
In this check, all go files with suffix _test.go
will be executed. These files usually contain test cases of some functions and modules. The following command will be used to run these tests:
e2e-tests
In this check, a OpenYurt cluster with two nodes will be set up to run e2e test cases under test
folder. OpenYurt also provide a way to run this test at your local host which you can find at . Currently, the following e2e test cases will run during this check:
Case | Description |
---|---|
cluster_info | Fetch cluster info from the cluster, including the number of pods and all namespaces |
pod_operate_test | Create/Delete pod on the edge node |
pod_operate_test_on_edge | Execute command in the pod on the edge node |