-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable current workflow and test split workflow.
- Loading branch information
Showing
5 changed files
with
87 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Per CUDA version | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
per_cuda_matrix: {type: string, required: true} | ||
|
||
test-repo-per-cuda-ver: | ||
uses: ./.github/workflows/test-repo-per-compiler.yml | ||
strategy: | ||
matrix: ${{ fromJSON(inputs.cuda_vers) }} | ||
with: | ||
repo: ${{ inputs.repo }} | ||
cxx_vers: ${{ inputs.cxx_vers }} | ||
cuda_ver: ${{ matrix.cuda_ver }} | ||
compilers: ${{ inputs.compilers }} |
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,46 @@ | ||
|
||
# This is the main workflow that runs on every PR and push to main | ||
name: pr_split | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- "pull-request/[0-9]+" | ||
|
||
# Only runs one instance of this workflow at a time for a given PR and cancels any in-progress runs when a new one starts. | ||
concurrency: | ||
group: ${{ github.workflow }}-on-${{ github.event_name }}-from-${{ github.ref_name }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
compute-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
BUILD_MATRIX: ${{ steps.compute-matrix.outputs.BUILD_MATRIX }} | ||
PER_CUDA_MATRIX: ${{ steps.compute-matrix.outputs.PER_CUDA_MATRIX }} | ||
CUDA_VERSIONS: ${{ steps.compute-matrix.outputs.CUDA_VERSIONS }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
- name: Compute matrix | ||
id: compute-matrix | ||
run: | | ||
cat ./ci/matrix.yaml | ||
BUILD_MATRIX=$(yq -o=json ./ci/matrix.yaml | jq -c '[.include[] | . as $o | {std: .std[]} + del($o.std)] | {include: . }' ) | ||
echo "BUILD_MATRIX=$BUILD_MATRIX" | tee -a "$GITHUB_OUTPUT" | ||
PER_CUDA_MATRIX=./ci/get_groups.sh $BUILD_MATRIX cuda $GITHUB_OUTPUT | ||
CUDA_VERSIONS=$(echo $PER_CUDA_MATRIX | jq 'keys') | ||
echo "CUDA_VERSIONS=$CUDA_VERSIONS" | tee -a "$GITHUB_OUTPUT" | ||
thrust: | ||
needs: compute-matrix | ||
uses: ./.github/workflows/per_cuda.yml | ||
strategy: | ||
matrix: ${{ fromJSON(needs.compute-matrix.outputs.CUDA_VERSIONS) }} }} | ||
with: | ||
per_cuda_matrix: ${{ needs.compute-matrix.outputs.PER_CUDA_MATRIX }} |
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,16 @@ | ||
#!/bin/bash | ||
|
||
# Check if input JSON, field, and file arguments are provided | ||
if [ "$#" -ne 3 ]; then | ||
echo "Usage: ./get_groups.sh <input_json> <field> <output_file>" | ||
exit 1 | ||
fi | ||
|
||
# Assign command-line arguments to variables | ||
input_json="$1" | ||
field="$2" | ||
output_file="$3" | ||
|
||
output=$(echo $input_json | jq -c --arg field "$field" 'include "group_by_field"; .include | group_by_field($field)') | ||
echo $output | tee -a "$output_file" | ||
|
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,4 @@ | ||
# Groups an array of objects by a field and returns an object with the field value as key and the array of objects as value | ||
# Handles nested fields (e.g. "compiler.name") | ||
def group_by_field($field): | ||
group_by(getpath($field | split("."))) | map( {(.[0] | getpath($field | split("."))): .}) | add; |