nix-github-actions icon indicating copy to clipboard operation
nix-github-actions copied to clipboard

Can't generate matrix when flake supports systems not in platforms map

Open purcell opened this issue 2 years ago • 2 comments

Hi! I have a flake which supports aarch64-darwin, but GitHub has no runners on that platform. Generating the matrix fails when there's no os found for a system discovered among the flake outputs.

The culprit is the following code, and I'll try to make a PR if I get a few moments:

https://github.com/nix-community/nix-github-actions/blob/bfeb681177b5128d061ebbef7ded30bc21a3f135/default.nix#L30

I guess the best solution would be to skip unsupported platforms but perhaps print a warning.

/cc @akirak

purcell avatar Aug 15 '23 17:08 purcell

Actually, it looks like this is a reasonable workaround:

    githubActions = nix-github-actions.lib.mkGithubMatrix {
      checks = { inherit (self.checks) "x86_64-linux" "x86_64-darwin"; };
    };

so I wonder if a change would be desirable here. If not, perhaps noting the above in the README would be sufficient.

purcell avatar Aug 15 '23 17:08 purcell

As I commented in the referred PR, one can use lib.getAttrs to select only supported platforms. And you can extend the mapping by passing platforms to the function. The documentation is not perfect, which is often the case with a Nix project.

akirak avatar Aug 15 '23 17:08 akirak