Your First Workflow in Kraken CI

  1. fetch sources from GitHub,
  2. run tests using Pytest,
  3. build a wheel package,
  4. upload built package to Kraken’s artifacts storage.

Project Preparation

Details about a new project setup in Kraken CI can be found in the previous article, part 1 as well.

  1. Create a project with a name: Demo
  2. Create a branch with a name: main
  3. Use a pre-created stage and rename it to: Hello World

Stage Hello World

The stage should look as follows:

Logs from the job with echo Hello World

Git Repo Checkout Step

Ok, let’s start extending our schema to make it more real life. First, let’s add a step for checking out a Git repository:

Logs from the job with git clone

Run Tests Step

Now let’s replace the step with listing the current directory with something more interesting, like running tests. Kraken provides several built-in tools for running tests. In the case of our Python sample project, we will use pytest built-in tool.

Logs from the job with running Pytest

Building Step

So if tests succeeded we could build a package of our Python project. Add step for building a wheel package using project’s setup.py script:

Logs from the job with packaging step with error
Logs from the job with successful deps installation and package building

Storing Artifacts Step

The results of building the sample project are two packages:

  • dist/sampleproject-2.0.0-py3-none-any.whl
  • dist/sampleproject-2.0.0.tar.gz
Logs from the job with storing build artifacts
The Run page, Artifacts tab

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store