docs(README): document running jobs locally

[skip ci]
This commit is contained in:
technofab 2024-10-13 15:50:18 +02:00
parent a47ec8cbeb
commit 67d75bd167

View file

@ -58,6 +58,21 @@ anything non-empty (eg. "yes") when triggering the pipeline.
The `build:nix-ci` job has a different special environment variable `NIX_CI_SKIP_CACHE` The `build:nix-ci` job has a different special environment variable `NIX_CI_SKIP_CACHE`
(useful if the generated pipeline is outdated but caching should generally still take place). (useful if the generated pipeline is outdated but caching should generally still take place).
### Run Jobs locally
You can run any job's script (+ before and after) locally with Nix for easier testing:
```sh
nix run .#gitlab-ci-job:<name>
```
There is also `.#gitlab-ci-job-deps:<name>` which generates and exports the required environment variables for each job:
- PATH (with all deps)
- any custom env variables which contain store paths to not break stuff when switching archs
Please see #8 for some issues and further improvements on this.
## Thanks to ## Thanks to
Some parts of this implementation are adapted/inspired from https://gitlab.com/Cynerd/gitlab-ci-nix Some parts of this implementation are adapted/inspired from https://gitlab.com/Cynerd/gitlab-ci-nix