runs-on does not support ${{ wrapped multiline expression }}: workflow hanging at startup
#168702
-
Why are you starting this discussion?Bug What GitHub Actions topic or product is this about?Workflow Configuration Discussion DetailsAs the following configuration shows, I have a very complex workflow matrix strategy while also having some special cases. So I use a jobs:
build-wheels:
if: |
github.repository_owner == 'metaopt' &&
(github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) &&
(github.event_name != 'pull_request' || !github.event.pull_request.draft)
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners
runs-on: |
${{
(matrix.archs == 'ARM64' && 'windows-11-arm') ||
(matrix.archs == 'aarch64' && 'ubuntu-24.04-arm') ||
matrix.runner
}}No error is raised for the configuration syntax, but the workflow hangs at startup without displaying any logs. The full configuration: https://github.com/metaopt/optree/blob/main/.github/workflows/build.yml#L108 jobs:
build-wheels:
name: Build wheels for Python ${{ matrix.python-version }} on ${{ (matrix.archs == 'ARM64' && 'windows-11-arm') || (matrix.archs == 'aarch64' && 'ubuntu-24.04-arm') || matrix.runner }} (${{ matrix.archs }})
if: |
github.repository_owner == 'metaopt' &&
(github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) &&
(github.event_name != 'pull_request' || !github.event.pull_request.draft)
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners
runs-on: ${{ (matrix.archs == 'ARM64' && 'windows-11-arm') || (matrix.archs == 'aarch64' && 'ubuntu-24.04-arm') || matrix.runner }}
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.13t"
- "3.14"
- "3.14t"
- "pypy-3.10"
- "pypy-3.11"
archs:
# Generic
- "auto64"
- "auto32"
# Linux
- "aarch64"
- "ppc64le"
- "s390x"
# Windows
- "ARM64"
exclude:
- runner: ubuntu-latest
python-version: "pypy-3.10"
archs: "ppc64le"
- runner: ubuntu-latest
python-version: "pypy-3.11"
archs: "ppc64le"
- runner: ubuntu-latest
python-version: "pypy-3.10"
archs: "s390x"
- runner: ubuntu-latest
python-version: "pypy-3.11"
archs: "s390x"
- runner: windows-latest
python-version: "3.9"
archs: "ARM64"
- runner: windows-latest
python-version: "3.10"
archs: "ARM64"
- runner: windows-latest
python-version: "pypy-3.10"
archs: "ARM64"
- runner: windows-latest
python-version: "pypy-3.11"
archs: "ARM64"
- python-version: "pypy-3.10"
archs: "auto32"
- python-version: "pypy-3.11"
archs: "auto32"
# Exclude archs of other platforms
- runner: ubuntu-latest
archs: "ARM64"
- runner: macos-latest
archs: "auto32"
- runner: macos-latest
archs: "aarch64"
- runner: macos-latest
archs: "ppc64le"
- runner: macos-latest
archs: "s390x"
- runner: macos-latest
archs: "ARM64"
- runner: windows-latest
archs: "aarch64"
- runner: windows-latest
archs: "ppc64le"
- runner: windows-latest
archs: "s390x"
include:
- runner: macos-latest
python-version: "3.13"
archs: "arm64_iphoneos"
- runner: macos-latest
python-version: "3.13"
archs: "arm64_iphonesimulator"
- runner: ubuntu-latest
python-version: "3.13"
archs: "arm64_v8a"
- runner: ubuntu-latest
python-version: "3.12"
archs: "wasm32"
fail-fast: false
timeout-minutes: 180
steps:
- ... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
The solution is a single e.g. jobs:
build-wheels:
if: |
github.repository_owner == 'metaopt' &&
(github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) &&
(github.event_name != 'pull_request' || !github.event.pull_request.draft)
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners
runs-on: |-
${{
(matrix.archs == 'ARM64' && 'windows-11-arm') ||
(matrix.archs == 'aarch64' && 'ubuntu-24.04-arm') ||
matrix.runner
}}
And everything is fine. GitHub Actions is probably looking for a runner with label "windows-11-arm\n", "ubuntu-24.04-arm\n" or "${{ matrix.runner}}\n", given it cannot find anyone online it expects you to start a self-hosted runner. I assume it could be really hard to actually get a runner with a newline in the label to get registred. Learning how YAML works in detail, might be good knowledge while writing workflows |
Beta Was this translation helpful? Give feedback.
The solution is a single
-after: |e.g.: |-to tell yaml you do not want an additional newline after}}.e.g.
And everything is fine.
GitHub Actions is probably looking for a runner with label "window…