poetry2nix/.github/generate-matrix.py
adisbladis 3f40ecc951 Switch testing strategy on Github Actions to one based on a dynamic matrix
Currently the output is unreadable (I have no idea without digging _what_ test failed).
2021-12-25 21:35:23 -08:00

27 lines
521 B
Python
Executable file

#!/usr/bin/env python3
import subprocess
import json
import sys
expr = 'builtins.toJSON (builtins.attrNames (import ./tests {}))'
if __name__ == '__main__':
attrs = json.loads(json.loads(subprocess.check_output([
"nix-instantiate",
"--eval",
"--expr",
expr
])))
matrix = [
{
"attr": attr
}
for attr in attrs
]
sys.stdout.write("::set-output name=matrix::")
json.dump({"include": matrix}, sys.stdout)
sys.stdout.flush()