Skip to content

Commit 228e140

Browse files
committed
Update Github scripts
1 parent 3904b19 commit 228e140

File tree

7 files changed

+41
-29
lines changed

7 files changed

+41
-29
lines changed

Diff for: .ci/ci_build.sh

+23-13
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ else
1616
CI_NAME="$(uname -s | tr '[:upper:]' '[:lower:]')"
1717
fi
1818

19-
if [[ "$BUILD_ARCHIVES" == '0' ]]; then
20-
IS_ARCHIVE_SKIPPED=" -DDO_NOT_BUILD_ARCHIVES=ON"
19+
if [ ${BUILD_ARCHIVES} = true ]; then
20+
echo "Build the package archive"
21+
IS_ARCHIVE_SKIPPED=" -DDO_NOT_BUILD_ARCHIVES=OFF"
2122
else
22-
IS_ARCHIVE_SKIPPED=" -DDO_NOT_BUILD_ARCHIVES=OFF"
23+
echo "Do not build the package archive"
24+
IS_ARCHIVE_SKIPPED=" -DDO_NOT_BUILD_ARCHIVES=ON"
2325
fi
2426

2527
# set environment variables if not exists (debug)
@@ -30,7 +32,7 @@ fi
3032
echo "Platform: ${PLATFORM}, build type: ${BUILD_TYPE}, CI_NAME: $CI_NAME, docker image: ${DOCKER_IMAGE}, docker type: ${DOCKER_TAG}, is archive enabled: ${IS_ARCHIVE_SKIPPED}, use ccache: ${USE_CCACHE}, reset ccache: ${RESET_CACHE}"
3133

3234
# clear ccache if neccesery
33-
if [[ "$RESET_CACHE" == '1' ]]; then
35+
if [ ${RESET_CACHE} = true ]; then
3436
echo "Clearing ccache"
3537
rm -rf .ccache || true
3638
rm -rf build/.ccache || true
@@ -40,12 +42,16 @@ fi
4042
if [[ "$CI_NAME" == 'osx' || "$CI_NAME" == 'darwin' ]]; then
4143
echo "Start: osx or darwin"
4244

43-
if [[ "$USE_CCACHE" == '1' ]]; then
44-
echo "Using ccache"
45-
BUILD_OPTION=""
45+
if [ ${USE_CCACHE} = true ]; then
46+
echo "Using ccache"
47+
if [[ $(uname -m) == 'arm64' ]]; then
48+
BUILD_OPTION=""
49+
else
50+
BUILD_OPTION="-DUSE_PRECOMPILED_HEADERS=OFF"
51+
fi
4652
else
4753
echo "Not using ccache"
48-
BUILD_OPTION="-DDISABLE_CCACHE_USAGE=ON"
54+
BUILD_OPTION="-DUSE_CCACHE_CACHING=OFF"
4955
fi
5056

5157
echo "Build option: ${BUILD_OPTION}"
@@ -65,12 +71,12 @@ elif [[ $CI_NAME == *"mingw64_nt"* || "$CI_NAME" == 'windows_nt' ]]; then
6571
echo "Start: windows"
6672
echo "Number of cores: $NUMBER_OF_PROCESSORS"
6773

68-
if [[ "$USE_CCACHE" == '1' ]]; then
74+
if [ ${USE_CCACHE} = true ]; then
6975
echo "Using ccache"
7076
BUILD_OPTION="${IS_ARCHIVE_SKIPPED}"
7177
else
7278
echo "Not using ccache"
73-
BUILD_OPTION="-DDISABLE_CCACHE_USAGE=ON ${IS_ARCHIVE_SKIPPED}"
79+
BUILD_OPTION="-DUSE_CCACHE_CACHING=OFF ${IS_ARCHIVE_SKIPPED}"
7480
fi
7581

7682
echo "Build option: ${BUILD_OPTION}"
@@ -95,14 +101,14 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
95101
mkdir -p ${CI_BUILD_DIR}/deploy
96102
mkdir -p .ccache
97103

98-
if [[ "$USE_CCACHE" == '1' ]]; then
104+
if [ ${USE_CCACHE} = true ]; then
99105
echo "Using ccache"
100106
BUILD_OPTION="${IS_ARCHIVE_SKIPPED}"
101107
cache_env="export CCACHE_DIR=/.ccache && ccache -z"
102108
ls -a .ccache
103109
else
104110
echo "Not using ccache"
105-
BUILD_OPTION="-DDISABLE_CCACHE_USAGE=ON ${IS_ARCHIVE_SKIPPED}"
111+
BUILD_OPTION="-DUSE_CCACHE_CACHING=OFF ${IS_ARCHIVE_SKIPPED}"
106112
cache_env="true"
107113
fi
108114

@@ -115,7 +121,11 @@ elif [[ "$CI_NAME" == 'linux' ]]; then
115121
chmod -R a+rw ${CI_BUILD_DIR}/deploy
116122
versionFile=`cat version`
117123
sed -i "s/{VERSION}/${versionFile}/" PKGBUILD
118-
sed -i "s/{BUILD_OPTION}/${BUILD_OPTION}/" PKGBUILD
124+
if [ ${USE_CCACHE} = true ]; then
125+
sed -i "s/{BUILD_OPTION}/${BUILD_OPTION} -DUSE_PRECOMPILED_HEADERS=OFF/" PKGBUILD
126+
else
127+
sed -i "s/{BUILD_OPTION}/${BUILD_OPTION}/" PKGBUILD
128+
fi
119129
chmod -R a+rw ${CI_BUILD_DIR}/.ccache
120130
else
121131
executeCommand="cd build && ( cmake ${BUILD_OPTION} -DPLATFORM=${PLATFORM} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DDEBIAN_NAME_TAG=${DOCKER_TAG} -DUSE_STANDARD_INSTALLER_NAME=${USE_STANDARD_INSTALLER_NAME} ../ || exit 2 )"

Diff for: .github/workflows/push-master.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
# pull_request:
66

77
env:
8-
USE_CACHE: "1"
9-
RESET_CACHE: "0"
10-
USE_CODEQL: "0"
8+
USE_CACHE: ${{ vars.USE_CACHE && vars.USE_CACHE || true }}
9+
RESET_CACHE: ${{ vars.RESET_CACHE && vars.RESET_CACHE || false }}
10+
USE_CODEQL: ${{ vars.USE_CODEQL && vars.USE_CODEQL || false }}
1111
BUILD_ARCHIVES: ${{ startsWith(github.event.ref, 'refs/tags') && 1 || 0 }}
1212

1313
jobs:
@@ -73,7 +73,7 @@ jobs:
7373

7474
# generate cache id
7575
- name: Prepare ccache timestamp
76-
if: env.USE_CACHE == '1'
76+
if: env.USE_CACHE == 'true'
7777
id: ccache_cache_timestamp
7878
shell: cmake -P {0}
7979
run: |
@@ -82,7 +82,7 @@ jobs:
8282
8383
# download cache
8484
- name: Download ccache files
85-
if: ( env.USE_CACHE == '1' )
85+
if: env.USE_CACHE == 'true'
8686
uses: actions/cache@v4
8787
with:
8888
path: .ccache
@@ -151,7 +151,7 @@ jobs:
151151

152152
# Generate cache id
153153
- name: Prepare ccache timestamp
154-
if: env.USE_CACHE == '1'
154+
if: env.USE_CACHE == 'true'
155155
id: ccache_cache_timestamp
156156
shell: cmake -P {0}
157157
run: |
@@ -160,7 +160,7 @@ jobs:
160160
161161
# Download cache
162162
- name: Download ccache files
163-
if: ( env.USE_CACHE == '1' )
163+
if: env.USE_CACHE == 'true'
164164
uses: actions/cache@v4
165165
with:
166166
path: build/.ccache
@@ -236,7 +236,7 @@ jobs:
236236
237237
# Generate cache id
238238
- name: Prepare ccache timestamp
239-
if: env.USE_CACHE == '1'
239+
if: env.USE_CACHE == 'true'
240240
id: ccache_cache_timestamp
241241
shell: cmake -P {0}
242242
run: |
@@ -245,7 +245,7 @@ jobs:
245245
246246
# Download cache
247247
- name: Download ccache files
248-
if: ( env.USE_CACHE == '1' )
248+
if: env.USE_CACHE == 'true'
249249
uses: actions/cache@v4
250250
with:
251251
path: build/.ccache
@@ -305,6 +305,8 @@ jobs:
305305
analyze:
306306
name: Analyze (CodeQL)
307307
runs-on: ubuntu-latest
308+
if: ${{ vars.USE_CODEQL == 'true' && vars.USE_CODEQL || false }}
309+
308310
permissions:
309311
actions: read
310312
contents: read
@@ -318,13 +320,13 @@ jobs:
318320
steps:
319321
- name: Checkout repository
320322
uses: actions/checkout@v4
321-
if: ( env.USE_CODEQL == '1' )
323+
if: env.USE_CODEQL == 'true'
322324
with:
323325
submodules: true
324326

325327
- name: Run composite CodeQL job for '${{matrix.language}}' language
326328
uses: ./.github/actions/codeql
327-
if: ( env.USE_CODEQL == '1' )
329+
if: env.USE_CODEQL == 'true'
328330
with:
329331
language: ${{matrix.language}}
330332

Diff for: include/effects/EffectDefinition.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#ifndef PCH_ENABLED
4-
#include <cstring>
4+
#include <string>
55
#include <functional>
66
#endif
77

Diff for: sources/grabber/osx/AVF/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers)
1515
target_precompile_headers(AVF-grabber REUSE_FROM precompiled_hyperhdr_headers)
1616
endif()
1717

18-
if(APPLE AND USE_CCACHE_CACHING)
18+
if(APPLE)
1919
set_source_files_properties(${CURRENT_SOURCE_DIR}/AVFGrabber.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
2020
endif()

Diff for: sources/grabber/osx/macOS/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers)
1515
target_precompile_headers(MACOS-grabber REUSE_FROM precompiled_hyperhdr_headers)
1616
endif()
1717

18-
if(APPLE AND USE_CCACHE_CACHING)
18+
if(APPLE)
1919
set_source_files_properties(${CURRENT_SOURCE_DIR}/macOsGrabber.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
2020
endif()

Diff for: sources/performance-counters/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers)
2121
target_precompile_headers(performance-counters REUSE_FROM precompiled_hyperhdr_headers)
2222
endif()
2323

24-
if(APPLE AND USE_CCACHE_CACHING)
24+
if(APPLE)
2525
set_source_files_properties(${CURRENT_SOURCE_DIR}/SystemPerformanceCounters.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
2626
endif()

Diff for: sources/sound-capture/macos/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ target_link_libraries(sound-capture-macos
1111
Qt${Qt_VERSION}::Network
1212
)
1313

14-
if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers AND (NOT APPLE OR NOT USE_CCACHE_CACHING))
14+
if(USE_PRECOMPILED_HEADERS AND COMMAND target_precompile_headers AND (NOT APPLE))
1515
target_precompile_headers(sound-capture-macos REUSE_FROM precompiled_hyperhdr_headers)
1616
endif()

0 commit comments

Comments
 (0)