Cache optimizations on Node CI (#892)
This commit is contained in:
43
.github/workflows/node-ci.yml
vendored
43
.github/workflows/node-ci.yml
vendored
@@ -139,15 +139,8 @@ jobs:
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Update ccache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
|
||||
run: |
|
||||
choco.exe upgrade ccache
|
||||
ccache.exe --version
|
||||
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up ccache
|
||||
- name: Set up ccache (MacOS/Linux)
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
||||
@@ -156,6 +149,17 @@ jobs:
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
|
||||
|
||||
- name: Set up ccache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
variant: 'sccache'
|
||||
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
||||
restore-keys: |
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
|
||||
|
||||
- name: Configure maplibre-gl-native (MacOS)
|
||||
if: runner.os == 'MacOS'
|
||||
run: |
|
||||
@@ -174,13 +178,31 @@ jobs:
|
||||
-DCMAKE_C_COMPILER=gcc-10 \
|
||||
-DCMAKE_CXX_COMPILER=g++-10
|
||||
|
||||
- name: "Create directory '${{ github.workspace }}/platform/windows/vendor/vcpkg/bincache' (Windows)"
|
||||
if: runner.os == 'Windows'
|
||||
run: mkdir -p ${{ github.workspace }}/platform/windows/vendor/vcpkg/bincache
|
||||
shell: bash
|
||||
|
||||
- name: Restore vcpkg cache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/platform/windows/vendor/vcpkg
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/buildtrees
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/packages
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/downloads
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/installed
|
||||
key: |
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ hashFiles( '.git/modules/platform/windows/vendor/vcpkg/HEAD' ) }}-${{ hashFiles( 'platform/windows/Get-VendorPackages.ps1' ) }}
|
||||
|
||||
- name: Configure maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
cmake . -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache.exe
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
||||
|
||||
- name: Build maplibre-gl-native (MacOS/Linux)
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
@@ -189,7 +211,6 @@ jobs:
|
||||
|
||||
- name: Build maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
|
||||
44
.github/workflows/node-release.yml
vendored
44
.github/workflows/node-release.yml
vendored
@@ -87,7 +87,7 @@ jobs:
|
||||
run: |
|
||||
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
||||
git submodule sync --recursive
|
||||
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true
|
||||
git -c core.longpaths=true -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive || true
|
||||
|
||||
- name: Get OS Architecture
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
@@ -140,14 +140,8 @@ jobs:
|
||||
if: runner.os == 'Windows'
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Update ccache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
choco.exe upgrade ccache
|
||||
ccache.exe --version
|
||||
echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV
|
||||
|
||||
- name: Set up ccache
|
||||
- name: Set up ccache (MacOS/Linux)
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
||||
@@ -156,6 +150,17 @@ jobs:
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
|
||||
|
||||
- name: Set up ccache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: hendrikmuhs/ccache-action@v1
|
||||
with:
|
||||
variant: 'sccache'
|
||||
key: ${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
||||
restore-keys: |
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ github.ref }}
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}
|
||||
|
||||
- name: Configure maplibre-gl-native (MacOS)
|
||||
if: runner.os == 'MacOS'
|
||||
run: |
|
||||
@@ -174,13 +179,31 @@ jobs:
|
||||
-DCMAKE_C_COMPILER=gcc-10 \
|
||||
-DCMAKE_CXX_COMPILER=g++-10
|
||||
|
||||
- name: "Create directory '${{ github.workspace }}/platform/windows/vendor/vcpkg/bincache' (Windows)"
|
||||
if: runner.os == 'Windows'
|
||||
run: mkdir -p ${{ github.workspace }}/platform/windows/vendor/vcpkg/bincache
|
||||
shell: bash
|
||||
|
||||
- name: Restore vcpkg cache (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
${{ github.workspace }}/platform/windows/vendor/vcpkg
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/buildtrees
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/packages
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/downloads
|
||||
!${{ github.workspace }}/platform/windows/vendor/vcpkg/installed
|
||||
key: |
|
||||
${{ matrix.runs-on }}-${{ env.BUILDTYPE }}-${{ github.job }}-${{ hashFiles( '.git/modules/platform/windows/vendor/vcpkg/HEAD' ) }}-${{ hashFiles( 'platform/windows/Get-VendorPackages.ps1' ) }}
|
||||
|
||||
- name: Configure maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
cmake . -B build \
|
||||
-G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache.exe
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
||||
|
||||
- name: Build maplibre-gl-native (MacOS/Linux)
|
||||
if: runner.os == 'MacOS' || runner.os == 'Linux'
|
||||
@@ -189,7 +212,6 @@ jobs:
|
||||
|
||||
- name: Build maplibre-gl-native (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
shell: cmd
|
||||
run: |
|
||||
cmake --build build
|
||||
|
||||
|
||||
Reference in New Issue
Block a user