mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
CI: Set ccache path based on template parameter
Currently, the templated steps in Caches.yml rely on the environment variable CCACHE_DIR being set to configure the ccache location. To prepare for multiple ccache paths, do not rely on this environment variable because only one ccache can use it at a time. Instead, pass the path into the template as a parameter.
This commit is contained in:
parent
5a2f41fff0
commit
4a4e614387
3 changed files with 21 additions and 9 deletions
|
@ -4,6 +4,7 @@ parameters:
|
||||||
toolchain: 'gcc'
|
toolchain: 'gcc'
|
||||||
build_directory: ''
|
build_directory: ''
|
||||||
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
||||||
|
serenity_ccache_path: $(CCACHE_DIR)
|
||||||
with_unicode_caches: true
|
with_unicode_caches: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -30,8 +31,8 @@ steps:
|
||||||
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
key: '"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
||||||
restoreKeys: |
|
restoreKeys: |
|
||||||
"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
|
"ccache" | "${{ parameters.os }}" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
|
||||||
path: $(CCACHE_DIR)
|
path: ${{ parameters.serenity_ccache_path }}
|
||||||
displayName: 'Compiler Cache'
|
displayName: 'Serenity Compiler Cache'
|
||||||
|
|
||||||
- ${{ if eq(parameters.with_unicode_caches, true) }}:
|
- ${{ if eq(parameters.with_unicode_caches, true) }}:
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
|
@ -47,6 +48,6 @@ steps:
|
||||||
displayName: 'UnicodeLocale Cache'
|
displayName: 'UnicodeLocale Cache'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
ccache -M 5G
|
CCACHE_DIR=${{ parameters.serenity_ccache_path }} ccache -M 5G
|
||||||
ccache -s
|
CCACHE_DIR=${{ parameters.serenity_ccache_path }} ccache -s
|
||||||
displayName: 'Configure ccache'
|
displayName: 'Configure Serenity ccache'
|
||||||
|
|
|
@ -7,7 +7,7 @@ jobs:
|
||||||
- job: 'Lagom_${{ parameters.os }}_${{ parameters.fuzzer }}'
|
- job: 'Lagom_${{ parameters.os }}_${{ parameters.fuzzer }}'
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- name: CCACHE_DIR
|
- name: SERENITY_CCACHE_DIR
|
||||||
value: $(Build.SourcesDirectory)/.ccache
|
value: $(Build.SourcesDirectory)/.ccache
|
||||||
|
|
||||||
- name: job_pool
|
- name: job_pool
|
||||||
|
@ -36,6 +36,7 @@ jobs:
|
||||||
arch: 'Lagom'
|
arch: 'Lagom'
|
||||||
toolchain: '$(toolchain)'
|
toolchain: '$(toolchain)'
|
||||||
build_directory: 'Meta/Lagom/Build'
|
build_directory: 'Meta/Lagom/Build'
|
||||||
|
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
||||||
${{ if eq(parameters.fuzzer, 'Fuzz') }}:
|
${{ if eq(parameters.fuzzer, 'Fuzz') }}:
|
||||||
with_unicode_caches: false
|
with_unicode_caches: false
|
||||||
${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
||||||
|
@ -59,6 +60,8 @@ jobs:
|
||||||
..
|
..
|
||||||
displayName: 'Create Build Environment'
|
displayName: 'Create Build Environment'
|
||||||
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
||||||
- ${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
- ${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
||||||
- script: |
|
- script: |
|
||||||
cmake -GNinja \
|
cmake -GNinja \
|
||||||
|
@ -77,11 +80,14 @@ jobs:
|
||||||
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
||||||
env:
|
env:
|
||||||
PATH: '$(PATH):$(Build.SourcesDirectory)/wabt-1.0.23/bin'
|
PATH: '$(PATH):$(Build.SourcesDirectory)/wabt-1.0.23/bin'
|
||||||
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
cmake --build .
|
cmake --build .
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
workingDirectory: $(Build.SourcesDirectory)/Meta/Lagom/Build
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
|
||||||
- ${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
- ${{ if eq(parameters.fuzzer, 'NoFuzz') }}:
|
||||||
- script: |
|
- script: |
|
||||||
|
@ -96,5 +102,5 @@ jobs:
|
||||||
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
|
UBSAN_OPTIONS: 'print_stacktrace=1:print_summary=1:halt_on_error=1'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
ccache -s
|
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
||||||
displayName: 'Cache Stats'
|
displayName: 'Cache Stats'
|
||||||
|
|
|
@ -6,7 +6,7 @@ jobs:
|
||||||
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
timeoutInMinutes: 0 # Setting to 0 means the maximum allowed timeout is used.
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- name: CCACHE_DIR
|
- name: SERENITY_CCACHE_DIR
|
||||||
value: $(Build.SourcesDirectory)/.ccache
|
value: $(Build.SourcesDirectory)/.ccache
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
|
@ -22,6 +22,7 @@ jobs:
|
||||||
arch: '${{ parameters.arch }}'
|
arch: '${{ parameters.arch }}'
|
||||||
toolchain: 'clang'
|
toolchain: 'clang'
|
||||||
build_directory: 'Build/${{ parameters.arch }}clang'
|
build_directory: 'Build/${{ parameters.arch }}clang'
|
||||||
|
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
|
||||||
- script: ./Toolchain/BuildClang.sh
|
- script: ./Toolchain/BuildClang.sh
|
||||||
displayName: Build Toolchain
|
displayName: Build Toolchain
|
||||||
|
@ -44,11 +45,15 @@ jobs:
|
||||||
-DCMAKE_CXX_COMPILER=g++-10
|
-DCMAKE_CXX_COMPILER=g++-10
|
||||||
displayName: 'Create Build Environment'
|
displayName: 'Create Build Environment'
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
workingDirectory: $(Build.SourcesDirectory)
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
cmake --build ./Build/superbuild
|
cmake --build ./Build/superbuild
|
||||||
displayName: 'Build'
|
displayName: 'Build'
|
||||||
workingDirectory: $(Build.SourcesDirectory)
|
workingDirectory: $(Build.SourcesDirectory)
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
ninja install && ninja image
|
ninja install && ninja image
|
||||||
|
@ -86,5 +91,5 @@ jobs:
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
ccache -s
|
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
||||||
displayName: 'Cache Stats'
|
displayName: 'Cache Stats'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue