Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 5 additions & 50 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: verify_cpp_template
run-name: Verify C++ project template
name: build_cpplinux
run-name: Build and test C++ library

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,9 +28,7 @@ on:
- CMakeLists.txt
- build_lib.sh
- generate_version.sh
- tailor_template_cleanup.sh
- .github/workflows/build_linux.yml
- .github/workflows/*.yml.tpl
pull_request:
branches:
- "master"
Expand All @@ -46,9 +44,7 @@ on:
- CMakeLists.txt
- build_lib.sh
- generate_version.sh
- tailor_template_cleanup.sh
- .github/workflows/build_linux.yml
- .github/workflows/*.yml.tpl

jobs:
build:
Expand All @@ -68,7 +64,7 @@ jobs:
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.runner == 'github-hosted' }}
run: |
sudo apt update
sudo apt install -y cmake ninja-build g++ ccache libboost-all-dev libeigen3-dev libtbb-dev python3-dev python3-pytest python3-yaml doxygen graphviz
sudo apt install -y cmake ninja-build g++ ccache libboost-all-dev libeigen3-dev libtbb-dev python3-dev python3-pytest

- name: Validate self-hosted prerequisites
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.runner == 'self-hosted' }}
Expand All @@ -79,22 +75,18 @@ jobs:
command -v ccache
command -v python3
python3 -m pytest --version
python3 -c 'import yaml'
command -v doxygen
command -v dot

- name: Restore compiler cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'tests/**', 'tailor_template_cleanup.sh', '.github/workflows/*.yml.tpl') }}
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'tests/**') }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.ref_name }}-
ccache-${{ runner.os }}-

- name: Configure
run: |
# Build artifacts are tested in a separate job, so keep CPU flags portable.
cmake -S . -B "${BUILD_DIR}" -GNinja \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DENABLE_TESTS=ON \
Expand Down Expand Up @@ -136,7 +128,7 @@ jobs:
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.runner == 'github-hosted' }}
run: |
sudo apt update
sudo apt install -y cmake ninja-build g++ libboost-all-dev libeigen3-dev libtbb-dev python3-dev python3-pytest python3-yaml doxygen graphviz
sudo apt install -y cmake ninja-build g++ libboost-all-dev libeigen3-dev libtbb-dev python3-dev python3-pytest

- name: Validate self-hosted prerequisites
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.runner == 'self-hosted' }}
Expand All @@ -145,9 +137,6 @@ jobs:
command -v ctest
command -v python3
python3 -m pytest --version
python3 -c 'import yaml'
command -v doxygen
command -v dot

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand All @@ -169,41 +158,7 @@ jobs:

- name: Restore test executable permissions
run: |
# GitHub artifact download may drop executable bits from binaries.
find "${CTEST_DIR}" -type f -path "*/tests/*" -exec chmod +x {} + || true

- name: Test
run: ctest --test-dir "${CTEST_DIR}" --output-on-failure --parallel 2 --no-tests=error

tailored-project-validation:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install tailored-project dependencies
run: |
sudo apt update
sudo apt install -y cmake ninja-build g++ libboost-all-dev libeigen3-dev python3-dev python3-pytest python3-yaml doxygen graphviz

- name: Materialize and exercise project workflows
shell: bash
run: |
set -Eeuo pipefail
scratch_dir="$(mktemp -d "${RUNNER_TEMP}/tailored-project-validation.XXXXXX")"
target_dir="${scratch_dir}/target"
git clone --no-local "${GITHUB_WORKSPACE}" "${target_dir}"
git -C "${target_dir}" checkout --detach "${GITHUB_SHA}"

(
cd "${target_dir}"
./tailor_template_cleanup.sh --apply --yes --project-namespace tailored_project
test -z "$(find .github/workflows -maxdepth 1 -name '*.tpl' -print -quit)"
python3 -c 'import pathlib, yaml; [yaml.safe_load(path.read_text()) for path in pathlib.Path(".github/workflows").glob("*.yml")]'
./build_lib.sh -B build_tailored_ci
cmake --preset docs
cmake --build --preset docs
)
165 changes: 0 additions & 165 deletions .github/workflows/build_linux.yml.tpl

This file was deleted.

50 changes: 3 additions & 47 deletions .github/workflows/build_linux_cuda.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: verify_cpp_cuda_template
run-name: Verify C++ project template with CUDA
name: build_cpplinux_cuda
run-name: Build and test C++ library (CUDA)

on:
workflow_dispatch:
Expand Down Expand Up @@ -60,40 +60,22 @@ jobs:
command -v nvidia-smi
command -v python3
python3 -m pytest --version
python3 -c 'import yaml'
command -v doxygen
command -v dot
nvidia-smi
nvcc --version

- name: Verify dormant workflow templates
id: workflow_contracts
run: python3 -m pytest -q tests/template_test/testWorkflowTemplates.py

- name: Restore compiler cache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-cuda-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'tests/**', '.github/workflows/build_linux_cuda.yml', '.github/workflows/build_linux_cuda.yml.tpl') }}
key: ccache-cuda-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'cmake/**', 'src/**', 'tests/**', '.github/workflows/build_linux_cuda.yml') }}
restore-keys: |
ccache-cuda-${{ runner.os }}-${{ github.ref_name }}-
ccache-cuda-${{ runner.os }}-

- name: Materialize tailored CUDA project
id: materialize_tailored_project
shell: bash
run: |
set -Eeuo pipefail
./tailor_template_cleanup.sh --apply --yes --project-namespace tailored_project
test -z "$(find .github/workflows -maxdepth 1 -name '*.tpl' -print -quit)"
python3 -c 'import pathlib, yaml; [yaml.safe_load(path.read_text()) for path in pathlib.Path(".github/workflows").glob("*.yml")]'

- name: Configure
run: |
# Build artifacts are tested in a separate job, so keep CPU flags portable.
cmake -S . -B "${BUILD_DIR}" -GNinja \
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DENABLE_TESTS=ON \
-DENABLE_CUDA=ON \
-DENABLE_OPTIX="${ENABLE_OPTIX}" \
Expand All @@ -108,21 +90,6 @@ jobs:
- name: Build
run: cmake --build "${BUILD_DIR}" --parallel 4

- name: Verify project CUDA source graph
shell: bash
run: |
set -Eeuo pipefail
compile_commands="${BUILD_DIR}/compile_commands.json"
test -f "${compile_commands}"
if ! grep -Fq "src/template_src_kernels/placeholder.cu" "${compile_commands}"; then
echo "Project CUDA source is absent from the compiled target graph." >&2
exit 1
fi
if grep -Fq "placeholder_to_ptx.ptx.cu" "${compile_commands}"; then
echo "OptiX PTX input entered ordinary CUDA compilation." >&2
exit 1
fi

- name: Show ccache stats
run: ccache --show-stats || true

Expand Down Expand Up @@ -158,16 +125,6 @@ jobs:
command -v ctest
command -v python3
python3 -m pytest --version
python3 -c 'import yaml'
command -v doxygen
command -v dot

- name: Match tailored project source tree
shell: bash
run: |
set -Eeuo pipefail
./tailor_template_cleanup.sh --apply --yes --project-namespace tailored_project
test -z "$(find .github/workflows -maxdepth 1 -name '*.tpl' -print -quit)"

- name: Download build artifacts
uses: actions/download-artifact@v4
Expand All @@ -189,7 +146,6 @@ jobs:

- name: Restore test executable permissions
run: |
# GitHub artifact download may drop executable bits from binaries.
find "${CTEST_DIR}" -type f -path "*/tests/*" -exec chmod +x {} + || true

- name: Test
Expand Down
Loading
Loading