feat: init Shellcode Executor v2.0 #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths-ignore: | |
| - 'docs/**' | |
| - '**.md' | |
| pull_request: | |
| branches: [ main ] | |
| release: | |
| types: [ published ] | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| # ════════════════════════════════════════════ | |
| # Linux Build & Test | |
| # ════════════════════════════════════════════ | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| build_type: [Release, Debug] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq cmake build-essential clang valgrind | |
| - name: Configure (${{ matrix.compiler }}, ${{ matrix.build_type }}) | |
| run: > | |
| cmake -B build | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DCMAKE_C_COMPILER=${{ matrix.compiler }} | |
| -DENABLE_TESTS=ON | |
| -DENABLE_EXAMPLES=ON | |
| -DENABLE_ASAN=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.build_type }} -j$(nproc) | |
| - name: Run Tests | |
| working-directory: build | |
| run: ctest --output-on-failure -j$(nproc) | |
| - name: Valgrind Check (Debug) | |
| if: matrix.build_type == 'Debug' | |
| run: | | |
| for test in build/tests/test_*; do | |
| echo "Running valgrind on $test..." | |
| valgrind --leak-check=full --error-exitcode=1 "$test" | |
| done | |
| - name: Upload Artifacts | |
| if: matrix.build_type == 'Release' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scloader-linux-${{ matrix.compiler }} | |
| path: build/bin/ | |
| # ════════════════════════════════════════════ | |
| # macOS Build & Test | |
| # ════════════════════════════════════════════ | |
| macos: | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| build_type: [Release, Debug] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Dependencies | |
| run: brew install cmake | |
| - name: Configure | |
| run: > | |
| cmake -B build | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| -DENABLE_TESTS=ON | |
| -DENABLE_EXAMPLES=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ matrix.build_type }} -j$(sysctl -n hw.logicalcpu) | |
| - name: Run Tests | |
| working-directory: build | |
| run: ctest --output-on-failure -j$(sysctl -n hw.logicalcpu) | |
| # ════════════════════════════════════════════ | |
| # Code Quality | |
| # ════════════════════════════════════════════ | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Tools | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y -qq clang-tidy cppcheck | |
| - name: Run cppcheck | |
| run: | | |
| cppcheck --enable=all --suppress=missingIncludeSystem \ | |
| --error-exitcode=1 \ | |
| src/ | |
| - name: Check Formatting | |
| run: | | |
| if command -v clang-format; then | |
| find src/ tests/ examples/ -name "*.c" -o -name "*.h" \ | |
| | xargs clang-format --dry-run -Werror | |
| fi |