mirror of https://github.com/OpenTTD/OpenTTD.git
Change: [CI] use vcpkg built-in caching mechanism
This commit is contained in:
parent
5d86588a45
commit
0c064b5119
|
@ -108,6 +108,14 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup vcpkg caching
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
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::Update apt"
|
echo "::group::Update apt"
|
||||||
|
@ -192,18 +200,13 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Prepare cache key
|
- name: Setup vcpkg caching
|
||||||
id: key
|
uses: actions/github-script@v6
|
||||||
run: |
|
|
||||||
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Enable vcpkg cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: /usr/local/share/vcpkg/installed
|
script: |
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
restore-keys: |
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
||||||
|
|
||||||
- name: Prepare vcpkg
|
- name: Prepare vcpkg
|
||||||
run: |
|
run: |
|
||||||
|
@ -272,22 +275,13 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Prepare cache key
|
- name: Setup vcpkg caching
|
||||||
id: key
|
uses: actions/github-script@v6
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
# Work around caching failure with GNU tar
|
|
||||||
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
|
|
||||||
|
|
||||||
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Enable vcpkg cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: vcpkg/installed
|
script: |
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
restore-keys: |
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
||||||
|
|
||||||
- name: Prepare vcpkg
|
- name: Prepare vcpkg
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -17,11 +17,6 @@ jobs:
|
||||||
# manylinux2014 is based on CentOS 7, but already has a lot of things
|
# manylinux2014 is based on CentOS 7, but already has a lot of things
|
||||||
# installed and preconfigured. It makes it easier to build OpenTTD.
|
# installed and preconfigured. It makes it easier to build OpenTTD.
|
||||||
image: quay.io/pypa/manylinux2014_x86_64
|
image: quay.io/pypa/manylinux2014_x86_64
|
||||||
volumes:
|
|
||||||
- /usr/local/share/vcpkg:/vcpkg
|
|
||||||
env:
|
|
||||||
ImageOS: ${{ env.ImageOS }}
|
|
||||||
ImageVersion: ${{ env.ImageVersion }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download source
|
- name: Download source
|
||||||
|
@ -57,18 +52,13 @@ jobs:
|
||||||
- name: Enable Rust cache
|
- name: Enable Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Prepare cache key
|
- name: Setup vcpkg caching
|
||||||
id: key
|
uses: actions/github-script@v6
|
||||||
run: |
|
|
||||||
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Enable vcpkg cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
with:
|
||||||
path: /vcpkg/installed
|
script: |
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
restore-keys: |
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
${{ steps.key.outputs.image }}-vcpkg-release
|
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
@ -132,7 +122,16 @@ jobs:
|
||||||
# We use vcpkg for our dependencies, to get more up-to-date version.
|
# We use vcpkg for our dependencies, to get more up-to-date version.
|
||||||
echo "::group::Install vcpkg and dependencies"
|
echo "::group::Install vcpkg and dependencies"
|
||||||
|
|
||||||
# Make Python3 available for other packages.
|
git clone https://github.com/microsoft/vcpkg /vcpkg
|
||||||
|
|
||||||
|
(
|
||||||
|
cd /vcpkg
|
||||||
|
./bootstrap-vcpkg.sh -disableMetrics
|
||||||
|
)
|
||||||
|
|
||||||
|
# Make Python3 available for other packages. This needs to be done
|
||||||
|
# first, as otherwise dependencies fail to build because Python3 is
|
||||||
|
# not available.
|
||||||
/vcpkg/vcpkg install python3
|
/vcpkg/vcpkg install python3
|
||||||
ln -sf /vcpkg/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
|
ln -sf /vcpkg/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,14 @@ 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@v6
|
||||||
|
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
|
||||||
env:
|
env:
|
||||||
HOMEBREW_NO_AUTO_UPDATE: 1
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
||||||
|
@ -47,20 +55,6 @@ jobs:
|
||||||
cargo install dump_syms
|
cargo install dump_syms
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Prepare cache key
|
|
||||||
id: key
|
|
||||||
run: |
|
|
||||||
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Enable vcpkg cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: /usr/local/share/vcpkg/installed
|
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
|
|
||||||
restore-keys: |
|
|
||||||
${{ steps.key.outputs.image }}-vcpkg-release
|
|
||||||
${{ steps.key.outputs.image }}-vcpkg-x64
|
|
||||||
|
|
||||||
- name: Prepare vcpkg
|
- name: Prepare vcpkg
|
||||||
run: |
|
run: |
|
||||||
vcpkg install \
|
vcpkg install \
|
||||||
|
|
|
@ -45,6 +45,14 @@ 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@v6
|
||||||
|
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
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@ -56,23 +64,6 @@ jobs:
|
||||||
cargo install dump_syms
|
cargo install dump_syms
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
|
|
||||||
- name: Prepare cache key
|
|
||||||
id: key
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
# Work around caching failure with GNU tar
|
|
||||||
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
|
|
||||||
|
|
||||||
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Enable vcpkg cache
|
|
||||||
uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: vcpkg/installed
|
|
||||||
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
|
|
||||||
restore-keys: |
|
|
||||||
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
|
|
||||||
|
|
||||||
- name: Prepare vcpkg
|
- name: Prepare vcpkg
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in New Issue