Skip to content

try using env for OS replacement #30

try using env for OS replacement

try using env for OS replacement #30

Workflow file for this run

name: cmake-test

Check failure on line 1 in .github/workflows/cmake-test.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/cmake-test.yml

Invalid workflow file

(Line: 11, Col: 12): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GH_JOB_NAME, (Line: 12, Col: 14): Unrecognized named-value: 'env'. Located at position 1 within expression: env.OS
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
jobs:
job:
name: ${{ env.GH_JOB_NAME }}
runs-on: ${{ env.OS }}
strategy:
fail-fast: false
matrix:
os: [macos, ubuntu, windows]
os_version: [latest]
compiler: [cl, clang++, g++]
build_type: [debug, release]
include:
- os: macos
compiler: clang++
triplet: arm64-osx
- os: ubuntu
compiler: clang++
triplet: x64-linux
- os: ubuntu
compiler: g++
triplet: x64-linux
- os: windows
compiler: cl
triplet: x64-windows
exclude:
- os: macos
compiler: cl
- os: macos
compiler: g++
- os: ubuntu
compiler: cl
- os: windows
compiler: clang++
- os: windows
compiler: g++
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_DISABLE_METRICS: true
OS: ${{ matrix.os }}-${{ matrix.os_version }}
# HACK: apparently ${{ github.jobs[github.job].name }} doesn't work with matrix
GH_JOB_NAME: ${{ matrix.os }}-${{ matrix.os_version }}-${{ matrix.compiler }}-${{ matrix.build_type }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ilammy/msvc-dev-cmd@v1
- uses: friendlyanon/setup-vcpkg@v1
with:
committish: 2025.12.12
cache-key: vcpkg-${{ env.GH_JOB_NAME }}-${{ hashFiles('vcpkg.json', '.github/vcpkg_overlays/**') }}
ignore-reserve-cache-error: true
- run: cmake --preset default
- run: cmake --build --parallel --preset default
- run: ctest --preset default --output-on-failure