3 Continuous integration
Vectornaut edited this page 2025-04-17 22:53:29 +00:00

Running continuous integration locally

Motivation

There are situations where you'll want to run the continuous integration workflow on a development machine. These include:

  • You want to check whether your code will pass continuous integration without committing your work.
  • You want to work on the continuous integration workflow.

(Optional) Setup

If you want to reproduce the behavior of the remote continuous integration system, you'll need to install Docker and Forgejo Runner.

Install Docker

On Ubuntu 22.04, I used the docker-compose package, although docker.io might be enough.

Install Forgejo Runner

Setting up Forgejo Runner for local, manual use is simpler than setting it up for remote, automated use.

On OpenSUSE Tumbleweed, you can install the forgejo-runner package by calling

sudo zypper install forgejo-runner

On other systems, you may need to install manually.

  1. Download these files from the release page:

    • The binary forgejo-runner-#.#.#-linux-amd64.
    • (Recommended) The signature forgejo-runner-#.#.#-linux-amd64.asc.
  2. (Recommended) Verify the binary's authenticity by checking its signature.

    1. Import Forgejo's public signing key by calling
      gpg --keyserver keys.openpgp.org --recv EB114F5E6C0DC2BCDD183550A4B61A2DC5923710
      
      If that doesn't work, you can download the key manually:
      1. Search in OpenPGP keyserver web interface for the fingerprint listed after --recv above.
      2. Download the key and call gpg --import on it.
    2. Check the signature by calling
      gpg --verify forgejo-runner-#.#.#-linux-amd64.asc forgejo-runner-#.#.#-linux-amd64
      
  3. Give the binary permission to be executed by the user who owns it.

  4. (Optional) For convenience, put the binary in your command search path. I like to do this by placing two symbolic links in ~/.local/bin, which is already on my search path:

    • A link called forgejo-runner-#.#.# that points to the location of the binary forgejo-runner-#.#.#-linux-amd64.
    • A link called forgejo-runner that points to forgejo-runner-#.#.#.

    Now I can launch a specific version of the runner by calling forgejo-runner-#.#.#, and I can launch my chosen default version by calling forgejo-runner.

Execution

Running directly on your development system

  1. Go into the app-proto folder and call
    RUSTFLAGS='-D warnings' cargo test
    

Continuous integration passes if all the tests pass.

Running in a Docker container using Forgejo Runner

  1. Go into the top level of the dyna3 repository and call
    forgejo-runner exec
    

This will only work if you've done the setup procedure above.