Skip to content

VCPKG

VCPKG #340

Workflow file for this run

name: Compile changes
on:
push:
branches-ignore: 'main'
pull_request:
branches-ignore: 'main'
env:
CARGO_TERM_COLOR: always
jobs:
compile:
name: Compile for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name: linux
os: ubuntu-latest
artifact_name: target/debug/legion-kb-rgb
asset_name: legion-kb-rgb-linux
triplet: x64-linux
vcpkgCommitId: 'ab67d6306b5e9af69684af5ec761c97731e75834'
- name: windows
os: windows-latest
artifact_name: target/debug/legion-kb-rgb.exe
asset_name: legion-kb-rgb-windows
triplet: x64-windows-static
vcpkgCommitId: 'ab67d6306b5e9af69684af5ec761c97731e75834'
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Download dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
sudo apt install -y libunwind-dev
sudo apt install -y libvpx-dev libyuv-dev libaom-dev
sudo apt-get install -y libx11-dev nasm libdbus-1-dev libudev-dev libxcb-randr0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libxi-dev libxtst-dev libusb-1.0-0-dev
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install nasm
elif [ "$RUNNER_OS" == "Windows" ]; then
echo "Nothing to do."
fi
shell: bash
- name: Set up VCPKG deps
uses: lukka/run-vcpkg@v11
id: runvcpkg
if: ${{ runner.os != 'Linux' }}
with:
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
# Run vcpkg with the command specified by the `runVcpkgFormatString` input.
runVcpkgInstall: true
vcpkgJsonGlob: '**/vcpkg.json'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
# - name: Prints output of run-vcpkg's action.
# run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
# - name: Set VCPKG_ROOT
# run: echo "VCPKG_ROOT=$(echo $VCPKG_INSTALLATION_ROOT)" >> $GITHUB_ENV
# shell: bash
- name: Build
shell: bash
run: cargo build --verbose
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}
path: ${{ matrix.artifact_name }}