mirror of https://github.com/OpenTTD/OpenTTD
Codechange: [Actions] Setup vcpkg via a composite action
parent
259830777c
commit
7fc047392c
|
@ -0,0 +1,25 @@
|
||||||
|
name: 'Setup vcpkg'
|
||||||
|
description: 'Installs vcpkg and initialises binary caching via NuGet'
|
||||||
|
inputs:
|
||||||
|
vcpkg-location:
|
||||||
|
description: 'Where to install vcpkg'
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install vcpkg
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
git clone https://github.com/microsoft/vcpkg "${{ inputs.vcpkg-location }}"
|
||||||
|
cd "${{ inputs.vcpkg-location }}"
|
||||||
|
./bootstrap-vcpkg.$(if [ "${{ runner.os }}" = "Windows" ]; then echo "bat"; else echo "sh"; fi) -disableMetrics
|
||||||
|
|
||||||
|
- name: Setup vcpkg caching
|
||||||
|
uses: actions/github-script@v7
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
|
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
||||||
|
|
|
@ -32,18 +32,10 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
|
|
||||||
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -34,18 +34,10 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
|
|
||||||
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
|
|
||||||
|
|
||||||
- name: Install OpenGFX
|
- name: Install OpenGFX
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -20,18 +20,10 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
|
|
||||||
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
|
|
||||||
|
|
||||||
- name: Install OpenGFX
|
- name: Install OpenGFX
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -26,18 +26,10 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
|
|
||||||
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -35,14 +35,6 @@ jobs:
|
||||||
- name: Enable Rust cache
|
- name: Enable Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
|
||||||
uses: actions/github-script@v7
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
echo "::group::Install system dependencies"
|
echo "::group::Install system dependencies"
|
||||||
|
@ -113,20 +105,15 @@ jobs:
|
||||||
# EOF
|
# EOF
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
# We use vcpkg for our dependencies, to get more up-to-date version.
|
|
||||||
echo "::group::Install vcpkg and dependencies"
|
|
||||||
|
|
||||||
git clone https://github.com/microsoft/vcpkg /vcpkg
|
|
||||||
|
|
||||||
(
|
|
||||||
cd /vcpkg
|
|
||||||
./bootstrap-vcpkg.sh -disableMetrics
|
|
||||||
)
|
|
||||||
|
|
||||||
echo "::group::Install breakpad dependencies"
|
echo "::group::Install breakpad dependencies"
|
||||||
cargo install --locked dump_syms
|
cargo install --locked dump_syms
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
|
- name: Setup vcpkg
|
||||||
|
uses: ./.github/actions/setup-vcpkg
|
||||||
|
with:
|
||||||
|
vcpkg-location: /vcpkg
|
||||||
|
|
||||||
- name: Install GCC problem matcher
|
- name: Install GCC problem matcher
|
||||||
uses: ammaraskar/gcc-problem-matcher@master
|
uses: ammaraskar/gcc-problem-matcher@master
|
||||||
|
|
||||||
|
|
|
@ -37,18 +37,10 @@ jobs:
|
||||||
- name: Enable Rust cache
|
- name: Enable Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}/vcpkg
|
|
||||||
${{ runner.temp }}/vcpkg/bootstrap-vcpkg.sh -disableMetrics
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
env:
|
env:
|
||||||
|
|
|
@ -45,18 +45,10 @@ jobs:
|
||||||
- name: Enable Rust cache
|
- name: Enable Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Setup vcpkg caching
|
- name: Setup vcpkg
|
||||||
uses: actions/github-script@v7
|
uses: ./.github/actions/setup-vcpkg
|
||||||
with:
|
with:
|
||||||
script: |
|
vcpkg-location: ${{ runner.temp }}/vcpkg
|
||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
||||||
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
|
||||||
|
|
||||||
- name: Install vcpkg
|
|
||||||
run: |
|
|
||||||
git clone https://github.com/microsoft/vcpkg ${{ runner.temp }}\vcpkg
|
|
||||||
${{ runner.temp }}\vcpkg\bootstrap-vcpkg.bat -disableMetrics
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
Loading…
Reference in New Issue