Dynamic matrix definition #3646
Unanswered
Kleidukos
asked this question in
Request a Feature
Replies: 1 comment 1 reply
-
For nix there is something similiar to get-tested nix-github-actions. I am currently trying to make Woodpecker work with it on datalad-nix/woodpecker. steps:
generate-matrix:
image: nixos/nix:latest
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
commands:
- nix-env -iA nixpkgs.jq nixpkgs.yq
- mkdir -p .woodpecker
- nix eval --json '.#githubActions.matrix' > .woodpecker/matrix.json
- |
echo "ATTR:" > .woodpecker/matrix.yml
cat .woodpecker/matrix.json | jq -r '.include[] | .attr' | sed 's/^/ - /' >> .woodpecker/matrix.yml
- cat .woodpecker/matrix.yml
build:
image: nixos/nix:latest
environment:
NIX_CONFIG: "experimental-features = nix-command flakes"
commands:
- echo "Building ${ATTR}"
- nix build -L '.#${ATTR}'
matrix:
from_file: .woodpecker/matrix.yml
when:
event:
- pull_request
- push Of course the matrix.yml file is only available after step 1 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to suggest that matrices can be generated from a JSON object, which enables CI jobs to be generated from a list of supported compiler versions that lives in the git tree of a project.
In Haskell for instance, project files have a list of supported compiler versions that a tool like get-tested parses to produce a list of jobs.
This is especially useful because there is one authoritative list of supported versions, that informs the CI.
Beta Was this translation helpful? Give feedback.
All reactions