Change to reflect the merged version of pull request #75

Vectornaut 2025-04-17 22:53:29 +00:00
parent 7863779784
commit 1c6444bf1e

@ -7,7 +7,13 @@ There are situations where you'll want to run the continuous integration workflo
- You want to check whether your code will pass continuous integration without committing your work.
- You want to work on the continuous integration workflow.
### Setup
### *(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`](https://packages.ubuntu.com/jammy/docker-compose) package, although [`docker.io`](https://packages.ubuntu.com/jammy/docker.io) might be enough.
#### Install Forgejo Runner
@ -43,45 +49,22 @@ On other systems, you may need to install manually.
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`.
#### *(Optional)* Install Docker and build the continuous integration container image
If you want to run the continuous integration workflow in a Docker container, like the remote CI system does, you'll need to install Docker and build the container image.
1. Install Docker
- On Ubuntu 22.04, I used the [`docker-compose`](https://packages.ubuntu.com/jammy/docker-compose) package, although [`docker.io`](https://packages.ubuntu.com/jammy/docker.io) might be enough.
2. Go to the `tools/ci-image` folder in the dyna3 repository and run the `build` script. The script tells Docker to build the image described by the neighboring `Dockerfile` and place it in Docker's image store with the tag `dyna3:ci`.
If you rebuild the Docker image with changes, the old version will still be sitting around in Docker's image store. Here's how to remove it.
- If you only ever ran the old version through Forgejo Runner, all the containers that referred to it should've been cleaned up automatically, so `docker image prune` should remove it.
- ⚠️ This will also remove any other unreferenced images you might have in the image store.
- If you ever ran the old version some other way, there may still be a container referring to it. In this case, get the old image's ID by finding it in the list displayed by `docker images`. Calling `docker image rm` on that ID should lead to an error that mentions which containers refer to the old image. Use `docker ps -a` to examine those containers and confirm that they're not needed anymore. Then use `docker rm` to remove the containers that refer to the old image.
### Execution
#### Running directly on your development system
1. Go into the top level of the dyna3 repository and call
1. Go into the `app-proto` folder and call
```bash
forgejo-runner exec --image -self-hosted
RUSTFLAGS='-D warnings' cargo test
```
This will only work if your build system is set up in the way the continuous integration workflow expects. For example, it assumes that you can call Cargo with the command `cargo`.
Continuous integration passes if all the tests pass.
#### Running in a Docker container
#### Running in a Docker container using Forgejo Runner
1. Go into the top level of the dyna3 repository and call
```bash
forgejo-runner exec
```
This will only work if you've done the Docker section of the setup procedure.
#### Running one particular job
The continuous integration workflow includes several jobs. If you only want to run one of them:
1. Look up the name of the job you want to run. Job names can be found in two places that I know of:
- Listed under `jobs` in the workflow description, `.forgejo/workflows/continuous-integration.yaml`.
- In the `[continuous-integration.yaml/JOB_NAME]` annotations in the workflow's console output.
2. Call one of the execution commands above with the extra option `--job JOB_NAME`.
This will only work if you've done the [setup](#setup) procedure above.