Skip to content

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:

  1. Checks out the code
  2. Installs pre-commit.
  3. 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:

  1. Sets up Go 1.19.
  2. Checks out the code.
  3. Builds the code
  4. Builds container images
  5. Builds the documentation
  6. Installs the built artifacts
  7. 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)