Skip to content

Commit

Permalink
temp: try to parse matrix from json obj
Browse files Browse the repository at this point in the history
  • Loading branch information
dlon committed Nov 27, 2023
1 parent 2b7ba22 commit 275be93
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/desktop-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Desktop - End-to-end tests
on:
schedule:
- cron: '0 0 * * *'
push:
workflow_dispatch:
inputs:
macos12:
Expand Down Expand Up @@ -47,16 +48,12 @@ jobs:
- name: Generate matrix for Linux builds
shell: bash
run: |
matrix=()
[[ "${{ github.event.inputs.debian11 }}" =~ ^(true|)$ ]] && matrix+=("debian11")
[[ "${{ github.event.inputs.debian12 }}" =~ ^(true|)$ ]] && matrix+=("debian12")
[[ "${{ github.event.inputs.ubuntu2004 }}" =~ ^(true|)$ ]] && matrix+=("ubuntu2004")
[[ "${{ github.event.inputs.ubuntu2204 }}" =~ ^(true|)$ ]] && matrix+=("ubuntu2204")
[[ "${{ github.event.inputs.ubuntu2304 }}" =~ ^(true|)$ ]] && matrix+=("ubuntu2304")
[[ "${{ github.event.inputs.fedora38 }}" =~ ^(true|)$ ]] && matrix+=("fedora38")
[[ "${{ github.event.inputs.fedora37 }}" =~ ^(true|)$ ]] && matrix+=("fedora37")
[[ "${{ github.event.inputs.fedora36 }}" =~ ^(true|)$ ]] && matrix+=("fedora36")
echo "linux_matrix="$( jq -c -n '$ARGS.positional' --args "${matrix[@]}" )"" >> $GITHUB_ENV
all='["debian11","debian12","ubuntu2004","ubuntu2204","ubuntu2304","fedora38","fedora37","fedora36"]'
inputs=${{ toJSON(github.event.inputs) }}
echo "FIXME: test ALL THE INPUTS: $inputs"
selected=$(jq -nc --argjson inputs "$inputs" --argjson key "$keys" '[ $key[] | select(($inputs[.] == true) or ($inputs[.] | not)) ]'
echo "FIXME: test SELECTED targets: $selected"
echo "linux_matrix=$selected" >> $GITHUB_ENV
- name: Generate matrix for Windows builds
shell: bash
run: |
Expand Down

0 comments on commit 275be93

Please sign in to comment.