-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for nvcc-specific matrix. (#243)
* Add support for nvcc-specific matrix. * Remove errnoeous runs-on * Fix path to compute-matrix script. * debug * debug. * debug. * lol, use hyphen not underscore. * Get absolute path for matrix file. * Fix reference to matrix_file var. * Remove extraneous matrix_query * Use composite action instead of reusable workflow for matrix. * Fix quotes around composite action inputs. * Need to checkout repo to get local composite action. * Fix quotes. * Add shell to composite action. * Specify shell in step. * Correctly use inputs for composite action. * debug * Fix expansion. * Remove debug. * Remove debug. * Escape quotes in jq query string. * Use underscore instead of hyphen to avoid needing quotes in query. * Use alternative syntax for jq query. * Missing quote. * Add post processing to set nvcc-specific matrix outputs. * Quotes around matrix output. * Single quotes. * Remove old compute-matrix reusable workflow. * Fix usage message. * Update devcontainer script to reference nvcc field. * Removed unused GITHUB_OUTPUT var. * EOF * Fix quotes.
- Loading branch information
Showing
6 changed files
with
108 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
name: Compute Matrix | ||
description: "Compute the matrix for a given matrix type from the specified matrix file" | ||
|
||
inputs: | ||
matrix_query: | ||
description: "The jq query used to specify the desired matrix. e.g., .pull_request.nvcc" | ||
required: true | ||
matrix_file: | ||
description: 'The file containing the matrix' | ||
required: true | ||
outputs: | ||
matrix: | ||
description: 'The requested matrix' | ||
value: ${{ steps.compute-matrix.outputs.MATRIX }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Compute matrix | ||
id: compute-matrix | ||
run: | | ||
MATRIX=$(./.github/actions/compute-matrix/compute-matrix.sh ${{inputs.matrix_file}} ${{inputs.matrix_query}} ) | ||
echo "matrix=$MATRIX" | tee -a $GITHUB_OUTPUT | ||
shell: bash -euxo pipefail {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# Check for the correct number of arguments | ||
if [ $# -ne 2 ]; then | ||
echo "Usage: $0 MATRIX_FILE MATRIX_QUERY" | ||
echo "MATRIX_FILE: The path to the matrix file." | ||
echo "MATRIX_QUERY: The jq query used to specify the desired matrix. e.g., '.pull-request.nvcc'" | ||
exit 1 | ||
fi | ||
|
||
# Get realpath before changing directory | ||
MATRIX_FILE=$(realpath "$1") | ||
MATRIX_QUERY="$2" | ||
|
||
# Ensure the script is being executed in its containing directory | ||
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; | ||
|
||
echo "Input matrix file:" >&2 | ||
cat "$MATRIX_FILE" >&2 | ||
echo "Query: $MATRIX_QUERY" >&2 | ||
echo $(yq -o=json "$MATRIX_FILE" | jq -c -r "$MATRIX_QUERY | map(. as \$o | {std: .std[]} + del(\$o.std))") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters