Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/actions/vcpkg-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: 'Setup vcpkg cache'
inputs:
vcpkg-root-path:
description: 'Path where to install vcpkg'
required: true
type: string
runs:
using: "composite"
steps:
- name: Install vcpkg
shell: bash
run: |
echo "Installing vcpkg"

echo "VCPKG_INSTALLATION_ROOT=${{ inputs.vcpkg-root-path }}" >> $GITHUB_ENV
echo "PATH=${{ inputs.vcpkg-root-path }}:$PATH" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_BINARY_CACHE=${{ inputs.vcpkg-root-path }}/.cache" >> $GITHUB_ENV
which vcpkg

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh --disableMetrics
mkdir ${{ inputs.vcpkg-root-path }}/.cache

- name: Env
shell: bash
run: |
echo "Vcpkg is installed at: $VCPKG_INSTALLATION_ROOT"
#echo "======================"
#env|sort

# Cache vcpkg
- name: Cache vcpkg
id: cache-vcpkg
uses: actions/cache@v4
with:
path: |
${{ inputs.vcpkg-root-path }}/.cache
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
24 changes: 9 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ run-name: Build No.${{ github.run_number }} on behalf of ${{ github.actor }}

on:
workflow_dispatch:
#pull_request:
# types: [opened, reopened, synchronize]
pull_request:
types: [opened, reopened, synchronize]
push:
branches: [main]

jobs:

build:
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

env:
VCPKG_INSTALLATION_ROOT: ${{ github.workspace }}/vcpkg

runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -28,7 +29,7 @@ jobs:
if: ${{ matrix.platform == 'linux' }}
run: |
gcc --version
sudo apt-get update
#sudo apt-get update

- name: Install Windows Prerequisites
if: ${{ matrix.platform == 'windows' }}
Expand All @@ -38,17 +39,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
- name: Setup cache
uses: ./.github/actions/vcpkg-cache
with:
debug: true
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: vcpkg install
run: |
vcpkg install
vcpkg-root-path: ${{ env.VCPKG_INSTALLATION_ROOT }}

- name: Configure project
run: |
Expand Down