Pullrequest
The pull Request Workflow, defined in the ci-tests.yml
file, is triggered on pull_request_target
events to the branches master
and main
has three jobs: linters, build and tests.
graph LR
A[pull_request_target] --> B[linters];
B --> C[build];
C --> D[tests];
Linters¶
This job performs the following steps:
- Checks out the code
- Installs pre-commit.
- Runs pre-commit hooks to execute code linting based on
.pre-commit-config.yaml
file
Linters can be executed locally with just make lint
Info
Main purpose for pre-commit is to allow developers to pass the Lint Checks before commiting the code. Same checks will be executed on all the commits once they are pushed to GitHub
Requirements:
- make
- pre-commit
$ make lint
Executing pre-commit for all files
pre-commit run --all-files
golangci-lint............................................................Passed
markdownlint.............................................................Passed
Test shell scripts with shellcheck.......................................Passed
check json...............................................................Passed
pre-commit executed.
Build¶
The "build" job uses the file builders.yml
file to build binaries and images, performing the following steps:
- Sets up Go 1.19.
- Checks out the code.
- Builds the code
- Builds container images
- Builds the documentation
- Installs the built artifacts
- Uploads the built binary file as an artifact named kube-burner.
Tests¶
The testing Workflow, defined in the tests-k8s.yml
file, runs tests defined in the test
directory of the repository.
Tests are orchestrated with bats
Tests can be executed locally with make test
, some requirements are needed though:
- make
- bats
- kubectl
- podman or docker (required to run kind)