Continuous integration

Prophecies' GitHub Actions workflow 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.

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 jobs.

  • 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 job.

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 job.

  • 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.

Learn more about how to trigger the publication of a new Docker image.

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.

Last updated

Prophecies is an open source project by the International Consortium of Investigative Journalists