# Expression-dense on purpose: a template engine has to resolve nested ${{ }} interpolation,
# the operator set, and the built-in functions before any schema check is meaningful.
name: Expression coverage

on: [push]

permissions:
  contents: read

jobs:
  compute:
    runs-on: ubuntu-latest
    if: >-
      github.event_name == 'push' &&
      !contains(github.event.head_commit.message, '[skip ci]')
    strategy:
      matrix:
        target: ${{ fromJSON('["linux", "darwin", "windows"]') }}
    env:
      CACHE_KEY: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
      LABEL: ${{ format('{0}/{1}@{2}', github.repository_owner, matrix.target, github.sha) }}
    steps:
      - uses: actions/checkout@v4
      - name: Conditional step
        if: matrix.target != 'windows' && success()
        run: echo "${{ join(fromJSON('["a","b"]'), '-') }}"
      - name: Always runs
        if: ${{ always() }}
        run: echo "${{ toJSON(matrix) }}"
      - name: Ternary-by-coalescing
        run: echo "${{ matrix.target == 'linux' && 'gnu' || 'other' }}"
