# Continuous integration

<figure><img src="https://github.com/icij/prophecies/actions/workflows/main.yml/badge.svg" alt=""><figcaption></figcaption></figure>

[Prophecies' GitHub Actions workflow](https://github.com/ICIJ/prophecies/actions) is designed to automate the process of linting, testing, and publishing Docker images. This workflow triggers on every push to the repository and is structured into several jobs to ensure code quality and reliability before a new Docker image is published.

## Jobs Overview

The workflow consists of six main jobs.

### `lint-backend`

* **Purpose**: Lints the backend code to ensure it adheres to Python coding standards.
* **Python Version**: Runs with Python 3.9.
* **Command**: Uses `pylint` to lint the `prophecies` directory.

### `test-backend`

* **Purpose**: Executes backend tests to verify the functionality.
* **Python Version**: Tests are run on both Python 3.9 and 3.10.
* **Command**: Runs backend tests using the `make test-back` command.

### `test-frontend`

* **Purpose**: Conducts frontend tests to ensure UI/UX integrity.
* **Node Version**: Tests are conducted on Node.js versions 16.x and 18.x.
* **Command**: Frontend tests are executed using the `make test-front` command.

### &#x20;`build`

* **Purpose**: Build artifacts to be publish with the next release.
* **Conditions**: This job runs only if the push event is a tag push starting with 'v', and it depends on the successful completion of the `lint-backend`, `test-backend`, and `test-frontend` job&#x73;**.**&#x20;
* **Command**: Run a python command to extract the OpenAPI schema file and store it.

### `package-publish`

* **Purpose**: Restore artifacts from the build job to publish them as Github Release.
* **Conditions**: This job runs only if the push event is a tag push starting with 'v', and it depends on the successful completion of the `build` jo&#x62;**.**&#x20;

### `docker-publish`

* **Conditions**: This job runs only if the push event is a tag push starting with 'v', and it depends on the successful completion of the `build` jo&#x62;**.**&#x20;
* **Step**: This job includes checking out the code, setting up QEMU and Docker Buildx, logging into Docker Hub, preparing the tag name based on the git tag, and finally building and pushing the Docker image.

{% hint style="info" %}
Learn more about how to trigger the [publication of a new Docker image](/prophecies/developers/publishing-a-new-docker-image.md).
{% endhint %}

## Secrets

To be able to push on the Docker Hub, this workflow must use the following secrets:

* **DOCKERHUB\_USERNAME**: The username for Docker Hub authentication.
* **DOCKERHUB\_PASSWORD**: The password or access token for Docker Hub authentication.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://icij.gitbook.io/prophecies/developers/continuous-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
