Skip to content

Trying to get the workflow to work #20

Trying to get the workflow to work

Trying to get the workflow to work #20

Workflow file for this run

name: CI
on: [push, pull_request]
env:
TOOLS_ROOT: ${{ env.HOME }}

Check failure on line 6 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 6, Col: 17): Unrecognized named-value: 'env'. Located at position 1 within expression: env.HOME
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
#os: [ubuntu-latest, windows-latest, macos-latest]
# os:
# - windows-latest
# # - ubuntu-latest
# # - macos-latest
# compiler: [gcc, clang, msvc]
# - gcc
# - llvm
# - clang
# - msvc
# you can specify the version after `-` like `llvm-13.0.0`.
# include:
# - os: "windows-latest"
# compiler: "msvc"
include:
# - os: ubuntu-latest
# compiler: gcc
# - os: ubuntu-latest
# compiler: clang
- os: windows-latest
compiler: msvc
# - os: macos-latest
# compiler: gcc
# - os: macos-latest
# compiler: clang
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- name: Cache
uses: actions/cache@v3
with:
path: |
~/vcpkg
./build/vcpkg_installed
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
restore-keys: |
${{ runner.os }}-${{ env.BUILD_TYPE }}-
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
vcpkg: true
cppcheck: true
- name: Prepate the PATH
run: |
if [[ "${{ runner.os }}" == "Windows" ]]; then
echo "$env:USERPROFILE\vcpkg" >> $GITHUB_PATH
echo "$env:USERPROFILE\ninja" >> $GITHUB_PATH
echo "$env:USERPROFILE" > $TOOLS_ROOT
else
echo "$HOME/vcpkg" >> $GITHUB_PATH
echo "$HOME/ninja" >> $GITHUB_PATH
fi
shell: bash
- name: Install dependencies
run: |
vcpkg install
- name: Build project
shell: bash
run: |
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=$TOOLS_ROOT/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build .