Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 39 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -561,38 +561,48 @@ jobs:
./acton-test | grep "Hello, world"


matrix_maker_run_linux:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setmatrix.outputs.matrix }}
steps:
- name: "Set Matrix for PR"
# Keep one package smoke in the PR loop; the full distro/target matrix
# still runs on main, tags, scheduled runs, and manual runs.
if: github.event_name == 'pull_request'
id: setmatrix_pr
run: |
MATRIX_JSON='{\"include\":[{\"os\":\"debian\",\"version\":\"11\",\"arch\":\"amd64\"}]}'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Emit unescaped JSON for the dynamic matrix

In the checked workflow shell snippet, this assignment writes literal backslashes to $GITHUB_OUTPUT ({\"include\":...}), so the later fromJson(needs.matrix_maker_run_linux.outputs.matrix) receives invalid JSON and run-linux cannot expand on PRs. The full-run matrix below uses the same escaping, so pushes/tags/schedules/manual runs are affected as well; the output should be raw JSON such as {"include":[...]} without the backslashes before quotes.

Useful? React with 👍 / 👎.

echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT

- name: "Set Matrix for full run"
if: github.event_name != 'pull_request'
id: setmatrix_full
run: |
MATRIX_JSON='{\"include\":[{\"os\":\"debian\",\"version\":\"11\",\"arch\":\"amd64\"},{\"os\":\"debian\",\"version\":\"12\",\"arch\":\"amd64\"},{\"os\":\"ubuntu\",\"version\":\"20.04\",\"arch\":\"amd64\"},{\"os\":\"ubuntu\",\"version\":\"22.04\",\"arch\":\"amd64\"},{\"os\":\"ubuntu\",\"version\":\"24.04\",\"arch\":\"amd64\"},{\"os\":\"ubuntu\",\"version\":\"24.04\",\"arch\":\"arm64\"},{\"os\":\"ubuntu\",\"version\":\"24.04\",\"arch\":\"amd64\",\"target\":\"x86_64-linux-musl\"},{\"os\":\"ubuntu\",\"version\":\"24.04\",\"arch\":\"arm64\",\"target\":\"aarch64-linux-musl\"}]}'
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT

- name: "Set final matrix output"
id: setmatrix
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "matrix=${{ steps.setmatrix_pr.outputs.matrix }}" >> $GITHUB_OUTPUT
else
echo "matrix=${{ steps.setmatrix_full.outputs.matrix }}" >> $GITHUB_OUTPUT
fi

- name: "Debug: Print matrix JSON"
run: |
echo "Matrix JSON:"
echo '${{ toJson(fromJson(steps.setmatrix.outputs.matrix)) }}'
echo "Event name: ${{ github.event_name }}"


run-linux:
needs: build-debs
needs: [build-debs, matrix_maker_run_linux]
strategy:
fail-fast: false
matrix:
include:
- os: "debian"
version: "11"
arch: "amd64"
- os: "debian"
version: "12"
arch: "amd64"
- os: "ubuntu"
version: "20.04"
arch: "amd64"
- os: "ubuntu"
version: "22.04"
arch: "amd64"
- os: "ubuntu"
version: "24.04"
arch: "amd64"
- os: "ubuntu"
version: "24.04"
arch: "arm64"
- os: "ubuntu"
version: "24.04"
arch: "amd64"
target: "x86_64-linux-musl"
- os: "ubuntu"
version: "24.04"
arch: "arm64"
target: "aarch64-linux-musl"
matrix: ${{ fromJson(needs.matrix_maker_run_linux.outputs.matrix) }}
env:
# This makes it possible for the GitHub Action itself to run using an
# older version of node, which is the only possibility to get it running
Expand Down