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
79 changes: 9 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,18 @@ on:
types: [ published ]

jobs:
test:
name: Test on ${{ matrix.os }} with ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
compiler: [gcc, clang, msvc]
exclude:
- os: windows-latest
compiler: gcc
- os: windows-latest
compiler: clang
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: msvc

build:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup GCC
if: matrix.compiler == 'gcc'
uses: egor-tensin/setup-gcc@v1
with:
version: 14

- name: Setup Clang
if: matrix.compiler == 'clang'
uses: egor-tensin/setup-clang@v1
with:
version: 19

- name: Setup MSVC
if: matrix.compiler == 'msvc'
uses: microsoft/setup-msbuild@v1.3

- name: Configure CMake (Unix)
if: runner.os != 'Windows'
- name: Setup Build Environment
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
sudo apt-get update
sudo apt-get install -y cmake clang

- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"

Comment on lines +17 to 24
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add checkout step to avoid building an empty workspace.

Without actions/checkout, CMake runs with no sources.

 steps:
+    - uses: actions/checkout@v4
     - name: Setup Build Environment
       run: |
         sudo apt-get update
         sudo apt-get install -y cmake clang
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Setup Build Environment
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }}
sudo apt-get update
sudo apt-get install -y cmake clang
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
- uses: actions/checkout@v4
- name: Setup Build Environment
run: |
sudo apt-get update
sudo apt-get install -y cmake clang
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles"
🤖 Prompt for AI Agents
.github/workflows/ci.yml lines 16-23: the workflow installs build tools and runs
CMake but lacks an actions/checkout step so the workspace is empty; add a step
before installing/building with uses: actions/checkout@v4 (or latest) to fetch
the repository so CMake has source files, i.e., insert a Checkout repository
step immediately before Setup Build Environment/Configure CMake.

- name: Build
run: cmake --build build --config Release
Expand All @@ -75,8 +41,7 @@ jobs:

- name: Run cppcheck
run: |
cppcheck --enable=all --std=c++20 --suppress=missingIncludeSystem \
--error-exitcode=1 CatalystCX.hpp
cppcheck --enable=all --std=c++20 --suppress=missingIncludeSystem CatalystCX.hpp

- name: Configure for clang-tidy
run: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
Expand Down Expand Up @@ -105,32 +70,6 @@ jobs:
- name: Run Tests with Sanitizer
run: cmake --build build --target test

package:
name: Package Release
runs-on: ubuntu-latest
needs: [test, static-analysis]
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4

- name: Create Package
run: |
mkdir -p catalystcx-${{ github.ref_name }}
cp CatalystCX.hpp catalystcx-${{ github.ref_name }}/
cp README.md catalystcx-${{ github.ref_name }}/
cp CMakeLists.txt catalystcx-${{ github.ref_name }}/
tar -czf catalystcx-${{ github.ref_name }}.tar.gz catalystcx-${{ github.ref_name }}/

- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./catalystcx-${{ github.ref_name }}.tar.gz
asset_name: catalystcx-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip

benchmark:
name: Performance Benchmarks
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ add_custom_target(test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

add_compile_definitions(
WCOREDUMP
)

# Install header
install(FILES CatalystCX.hpp DESTINATION include)

Expand Down
Loading