Skip to content

Commit f787c7e

Browse files
committed
feat(Setup): allow shallow clones
1 parent e462d2c commit f787c7e

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

.github/actions/test/action.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/build-linux.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,21 @@ jobs:
3333
build-essential cmake git wget
3434
3535
- name: Clone repositories
36-
run: cmake -DREDASM_FETCH_TESTS=${{ inputs.run_tests && 'ON' || 'OFF' }} -P Setup.cmake
36+
run: cmake -DREDASM_FETCH_TESTS=${{ inputs.run_tests && 'ON' || 'OFF' }} -DREDASM_SHALLOW=ON -P Setup.cmake
3737

3838
- name: Configure
3939
run: cmake -B build \
4040
-DCMAKE_BUILD_TYPE=Release \
4141
-DCMAKE_INSTALL_PREFIX=/usr \
42-
${{ inputs.run_tests && format('-DREDASM_FETCH_TESTS=ON -DREDASM_SAMPLES={0}/samples', github.workspace) || '' }}
42+
${{ inputs.run_tests && format('-DREDASM_SAMPLES={0}/samples', github.workspace) || '' }}
4343

4444
- name: Build
4545
run: cmake --build build --parallel
4646

4747
- name: Run tests
4848
if: inputs.run_tests
49-
uses: ./.github/actions/test
49+
shell: bash
50+
run: ctest --test-dir build --output-on-failure
5051

5152
- name: Install into AppDir
5253
run: cmake --install build --prefix AppDir/usr

.github/workflows/build-windows.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,22 @@ jobs:
2727
cache: true
2828

2929
- name: Clone repositories
30-
run: cmake -DREDASM_FETCH_TESTS=${{ inputs.run_tests && 'ON' || 'OFF' }} -P Setup.cmake
30+
run: cmake -DREDASM_FETCH_TESTS=${{ inputs.run_tests && 'ON' || 'OFF' }} -DREDASM_SHALLOW=ON -P Setup.cmake
3131

3232
- name: Configure
3333
run: cmake -B build `
3434
-DCMAKE_PREFIX_PATH="${{ env.Qt6_DIR }}" `
35-
${{ inputs.run_tests && format('-DREDASM_FETCH_TESTS=ON -DREDASM_SAMPLES={0}/samples', github.workspace) || '' }}
35+
${{ inputs.run_tests && format('-DREDASM_SAMPLES={0}/samples', github.workspace) || '' }}
3636

3737
- name: Build
3838
run: cmake --build build --config Release --parallel
3939

4040
- name: Run tests
4141
if: inputs.run_tests
42-
uses: ./.github/actions/test
42+
shell: bash
43+
run: |
44+
echo "$(pwd)/build/redasm/Release" >> $GITHUB_PATH
45+
ctest --test-dir build -C Release --output-on-failure
4346
4447
- name: Install
4548
run: cmake --install build --prefix redasm-windows-x86_64 --config Release

Setup.cmake

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ if(NOT DEFINED REDASM_FETCH_TESTS)
1010
set(REDASM_FETCH_TESTS OFF)
1111
endif()
1212

13+
if(NOT DEFINED REDASM_SHALLOW)
14+
set(REDASM_SHALLOW OFF)
15+
endif()
16+
17+
if(REDASM_SHALLOW)
18+
set(depth_arg "--depth=1")
19+
else()
20+
set(depth_arg "")
21+
endif()
22+
1323
# Version overrides: set via -D or environment for CI/release builds
1424
# e.g: cmake -DCORE_VERSION=v4.0.1 -P setup.cmake
1525
set(CORE_VERSION $ENV{CORE_VERSION})
@@ -89,7 +99,7 @@ foreach(repo ${REPOS})
8999
message(STATUS "[${repo}] cloning @ ${version}...")
90100

91101
execute_process(
92-
COMMAND ${GIT_EXECUTABLE} clone --branch "${version}" --progress "${BASE_URL}/${repo}" "${dest}"
102+
COMMAND ${GIT_EXECUTABLE} clone ${depth_arg} --branch "${version}" --progress "${BASE_URL}/${repo}" "${dest}"
93103
RESULT_VARIABLE result
94104
)
95105

0 commit comments

Comments
 (0)