Skip to content

Commit d7727ef

Browse files
committed
[CI] Move cleanup and checkout steps to github actions.
1 parent 10d5727 commit d7727ef

File tree

2 files changed

+73
-70
lines changed

2 files changed

+73
-70
lines changed

.github/workflows/root-ci-config/build_root.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def main():
6565
if not pull_request:
6666
build_utils.print_info("head_ref same as base_ref, assuming non-PR build")
6767

68-
cleanup_previous_build()
68+
if WINDOWS:
69+
cleanup_previous_build()
6970

7071
# Load CMake options from .github/workflows/root-ci-config/buildconfig/[platform].txt
7172
this_script_dir = os.path.dirname(os.path.abspath(__file__))
@@ -113,7 +114,8 @@ def main():
113114
build_utils.print_warning(f'Failed to download: {err}')
114115
args.incremental = False
115116

116-
git_pull("src", args.repository, args.base_ref)
117+
if WINDOWS:
118+
git_pull("src", args.repository, args.base_ref)
117119

118120
if pull_request:
119121
base_head_sha = get_base_head_sha("src", args.repository, args.sha, args.head_sha)
@@ -226,11 +228,6 @@ def cleanup_previous_build():
226228
}}
227229
New-Item -Force -Type directory -Path {WORKDIR}
228230
""")
229-
else:
230-
# mac/linux/POSIX
231-
result = subprocess_with_log(f"""
232-
rm -rf {WORKDIR}/*
233-
""")
234231

235232
if result != 0:
236233
die(result, "Failed to clean up previous artifacts")
@@ -278,9 +275,9 @@ def download_artifacts(obj_prefix: str):
278275
# TODO: Simplify after ROOT is Python 3.12+ only
279276
# c.f. https://docs.python.org/3.12/library/tarfile.html#extraction-filters
280277
if hasattr(tarfile, "data_filter"):
281-
tar.extractall(WORKDIR, filter="data")
278+
tar.extract("build", WORKDIR, filter="data")
282279
else:
283-
tar.extractall(WORKDIR)
280+
tar.extract("build", WORKDIR)
284281

285282
build_utils.log.add(f'\ncd {WORKDIR} && tar -xf {tar_path}\n')
286283

.github/workflows/root-ci.yml

Lines changed: 67 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,14 @@ jobs:
123123
${{ (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && join( matrix.overrides, ', ' )) || '' }}
124124
125125
steps:
126+
- name: Cleanup workdir
127+
run: rm -rf ${{ github.workspace }}/*
128+
126129
- name: Checkout
127130
uses: actions/checkout@v4
128131
with:
129132
ref: ${{ inputs.ref_name }}
133+
path: "src"
130134

131135
- name: Apply option overrides from matrix for this job for non-release builds
132136
if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && matrix.overrides != NaN }}
@@ -159,7 +163,7 @@ jobs:
159163

160164
- name: Set up curl CA bundle for Davix to work with https
161165
run: 'echo SSL_CERT_FILE=/opt/local/share/curl/curl-ca-bundle.crt >> $GITHUB_ENV'
162-
166+
163167
- name: Pull Request Build
164168
shell: bash -leo pipefail {0}
165169
if: github.event_name == 'pull_request'
@@ -231,13 +235,7 @@ jobs:
231235
build-windows:
232236
# For any event that is not a PR, the CI will always run. In PRs, the CI
233237
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
234-
if: |
235-
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
236-
(github.event_name == 'pull_request' && !(
237-
contains(github.event.pull_request.title, '[skip-ci]') ||
238-
contains(github.event.pull_request.title, '[skip ci]') ||
239-
contains(github.event.pull_request.labels.*.name, 'skip ci')
240-
))
238+
if: false
241239

242240
permissions:
243241
contents: read
@@ -277,6 +275,7 @@ jobs:
277275
uses: actions/checkout@v4
278276
with:
279277
ref: ${{ inputs.ref_name }}
278+
path: "src"
280279

281280
- name: Pull Request Build
282281
if: github.event_name == 'pull_request'
@@ -378,50 +377,50 @@ jobs:
378377
include:
379378
- image: fedora42
380379
overrides: ["CMAKE_CXX_STANDARD=23"]
381-
- image: fedora43
382-
overrides: ["CMAKE_CXX_STANDARD=23"]
383-
is_special: true
384-
- image: alma8
385-
- image: alma9
386-
overrides: ["CMAKE_BUILD_TYPE=Debug"]
387-
- image: alma10
388-
- image: ubuntu22
389-
overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"]
390-
- image: ubuntu2404
391-
overrides: ["CMAKE_BUILD_TYPE=Debug"]
392-
- image: ubuntu2504
393-
overrides: ["CMAKE_CXX_STANDARD=23"]
394-
- image: ubuntu2510
395-
is_special: true
396-
overrides: ["CMAKE_CXX_STANDARD=23"]
397-
- image: debian125
398-
overrides: ["CMAKE_CXX_STANDARD=20", "dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"]
399-
- image: debian13
400-
overrides: ["dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"]
401-
# Special builds
402-
- image: alma9
403-
is_special: true
404-
property: modules_off
405-
overrides: ["runtime_cxxmodules=Off"]
406-
- image: alma9
407-
is_special: true
408-
property: march_native
409-
overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "CMAKE_CXX_FLAGS=-march=native", "CMAKE_C_FLAGS=-march=native", "builtin_zlib=ON", "builtin_zstd=ON"]
410-
- image: alma9
411-
is_special: true
412-
property: arm64
413-
overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "builtin_zlib=ON", "builtin_zstd=ON"]
414-
architecture: ARM64
415-
- image: alma10
416-
is_special: true
417-
property: "clang Ninja"
418-
overrides: ["CMAKE_C_COMPILER=clang", "CMAKE_CXX_COMPILER=clang++"]
419-
cmake_generator: Ninja
420-
# Fedora Rawhide with Python debug build
421-
- image: rawhide
422-
is_special: true
423-
property: "Fedora pydebug"
424-
overrides: ["CMAKE_CXX_STANDARD=23"]
380+
# - image: fedora43
381+
# overrides: ["CMAKE_CXX_STANDARD=23"]
382+
# is_special: true
383+
# - image: alma8
384+
# - image: alma9
385+
# overrides: ["CMAKE_BUILD_TYPE=Debug"]
386+
# - image: alma10
387+
# - image: ubuntu22
388+
# overrides: ["imt=Off", "CMAKE_BUILD_TYPE=Debug"]
389+
# - image: ubuntu2404
390+
# overrides: ["CMAKE_BUILD_TYPE=Debug"]
391+
# - image: ubuntu2504
392+
# overrides: ["CMAKE_CXX_STANDARD=23"]
393+
# - image: ubuntu2510
394+
# is_special: true
395+
# overrides: ["CMAKE_CXX_STANDARD=23"]
396+
# - image: debian125
397+
# overrides: ["CMAKE_CXX_STANDARD=20", "dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"]
398+
# - image: debian13
399+
# overrides: ["dev=ON", "CMAKE_CXX_FLAGS=-Wsuggest-override"]
400+
# # Special builds
401+
# - image: alma9
402+
# is_special: true
403+
# property: modules_off
404+
# overrides: ["runtime_cxxmodules=Off"]
405+
# - image: alma9
406+
# is_special: true
407+
# property: march_native
408+
# overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "CMAKE_CXX_FLAGS=-march=native", "CMAKE_C_FLAGS=-march=native", "builtin_zlib=ON", "builtin_zstd=ON"]
409+
# - image: alma9
410+
# is_special: true
411+
# property: arm64
412+
# overrides: ["CMAKE_BUILD_TYPE=RelWithDebInfo", "builtin_zlib=ON", "builtin_zstd=ON"]
413+
# architecture: ARM64
414+
# - image: alma10
415+
# is_special: true
416+
# property: "clang Ninja"
417+
# overrides: ["CMAKE_C_COMPILER=clang", "CMAKE_CXX_COMPILER=clang++"]
418+
# cmake_generator: Ninja
419+
# # Fedora Rawhide with Python debug build
420+
# - image: rawhide
421+
# is_special: true
422+
# property: "Fedora pydebug"
423+
# overrides: ["CMAKE_CXX_STANDARD=23"]
425424
# Disable GPU builds until the DNS problem is solved
426425
# - image: ubuntu2404-cuda
427426
# is_special: true
@@ -453,17 +452,17 @@ jobs:
453452
POST_INSTALL_DIR: /github/home/ROOT-CI/PostInstall
454453

455454
steps:
456-
- name: Configure large ccache
457-
if: ${{ matrix.is_special }}
458-
run: |
459-
ccache -o max_size=5G
460-
ccache -p || true
461-
ccache -s || true
455+
- name: Cleanup workdir
456+
run: rm -rf *
457+
458+
- name: Directory tree
459+
run: ls -l
462460

463-
- name: Configure small ccache
464-
if: ${{ !matrix.is_special }}
461+
- name: Configure ccache
462+
env:
463+
CCACHE_SIZE: ${{ matrix.is_special && '5G' || '1.5G' }}
465464
run: |
466-
ccache -o max_size=1.5G
465+
ccache -o max_size=${CCACHE_SIZE}
467466
ccache -p || true
468467
ccache -s || true
469468
@@ -473,10 +472,17 @@ jobs:
473472
# code of the `if`.
474473
run: 'if [ -d /py-venv/ROOT-CI/bin/ ]; then . /py-venv/ROOT-CI/bin/activate && echo PATH=$PATH >> $GITHUB_ENV; fi'
475474

475+
- name: Directory tree
476+
run: ls -l
477+
476478
- name: Checkout
477479
uses: actions/checkout@v4
478480
with:
479481
ref: ${{ inputs.ref_name }}
482+
path: "src"
483+
484+
- name: Directory tree
485+
run: ls -l
480486

481487
- name: Dump GitHub context
482488
env:

0 commit comments

Comments
 (0)