Skip to content

Merge pull request #49 from ragusaa/CLAM-2625-UpdateFlevel #179

Merge pull request #49 from ragusaa/CLAM-2625-UpdateFlevel

Merge pull request #49 from ragusaa/CLAM-2625-UpdateFlevel #179

Workflow file for this run

name: CMake Build
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- rel/*
- dev/*
- main
pull_request:
branches:
- rel/*
- dev/*
- main
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_GIT_REF: 8a9a97315aefb3f8bc5d81bf66ca0025938b9c91
jobs:
# TODO: Some day add support for building on Windows.
#
# build-windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v1
# - name: Install pytest for easier to read test results
# run: python3 -m pip install pytest
# - uses: lukka/get-cmake@latest
# # Restore from cache the previously built ports. If cache-miss, download, build vcpkg ports.
# - name: Restore LLVM vcpkg port from cache or install vcpkg and build LLVM port
# # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
# uses: lukka/run-vcpkg@v5
# id: runvcpkg
# with:
# vcpkgArguments: "llvm"
# vcpkgGitCommitId: "${{ env.VCPKG_GIT_REF }}"
# vcpkgTriplet: "x64-windows"
# - name: Print the VCPKG_ROOT & VCPKG_TRIPLET (for debugging)
# shell: bash
# run: echo "'${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}' '${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
# - name: dir the VCPKG_ROOT
# run: dir ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}
# - name: Create Build Directory
# shell: bash
# # Some projects don't allow in-source building, so create a separate build directory
# # We'll use this as our working directory for all subsequent commands
# run: cmake -E make_directory ${{runner.workspace}}/build
# - name: Run CMake+Ninja with triplet (cmd)
# uses: lukka/run-cmake@main
# id: runcmake_cmd
# with:
# cmakeGenerator: "Ninja" # Visual Studio 15 2017
# cmakeListsOrSettingsJson: "CMakeListsTxtBasic"
# cmakeListsTxtPath: "${{runner.workspace}}/clamav-bytecode-compiler/CMakeLists.txt"
# useVcpkgToolchainFile: true
# cmakeAppendedArgs: '-A x64 -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DENABLE_EXAMPLES=ON -- -v'
# cmakeBuildType: "${{ env.BUILD_TYPE }}"
# vcpkgTriplet: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}
# buildDirectory: "${{runner.workspace}}/build"
# - name: Install Clang for running compiler
# uses: crazy-max/ghaction-chocolatey@v1
# with:
# args: install wixtoolset llvm
# - name: Test
# working-directory: ${{runner.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{ env.BUILD_TYPE }} -V
# - name: Create Installer
# working-directory: ${{runner.workspace}}/build
# run: cpack -C ${{ env.BUILD_TYPE }}
#
# build-macos:
# runs-on: macos-latest
# steps:
# - uses: actions/checkout@v1
# - name: Install Dependencies
# run: brew install llvm clamav
# - name: Install pytest for easier to read test results
# run: python3 -m pip install pytest
# - uses: lukka/get-cmake@latest
# - name: Create Build Directory
# shell: bash
# # Some projects don't allow in-source building, so create a separate build directory
# # We'll use this as our working directory for all subsequent commands
# run: cmake -E make_directory ${{runner.workspace}}/build
# - name: Configure CMake
# # Use a bash shell so we can use the same syntax for environment variable
# # access regardless of the host operating system
# working-directory: ${{runner.workspace}}/build
# # Note the current convention is to use the -S and -B options here to specify source
# # and build directories, but this is only available with CMake 3.13 and higher.
# # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# run:
# cmake ${{runner.workspace}}/clamav-bytecode-compiler -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
# -DENABLE_EXAMPLES=ON
# - name: Build
# shell: bash
# working-directory: ${{runner.workspace}}/build
# # Execute the build. You can specify a specific target with "--target <NAME>"
# run: cmake --build . --config ${{ env.BUILD_TYPE }}
# - name: Test
# shell: bash
# working-directory: ${{runner.workspace}}/build
# # Execute tests defined by the CMake configuration.
# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{ env.BUILD_TYPE }} -V
build-ubuntu:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- name: Update package listings
run:
sudo apt-get update
- name: Install Dependencies
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
sudo apt-get install -y clamav
- name: Install pytest for easier to read test results
run: python3 -m pip install pytest
- uses: lukka/get-cmake@latest
- name: Create Build Directory
shell: bash
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{runner.workspace}}/build
- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run:
cmake ${{runner.workspace}}/clamav-bytecode-compiler -D CMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -D ENABLE_EXAMPLES=ON
- name: Build
shell: bash
working-directory: ${{runner.workspace}}/build
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config ${{ env.BUILD_TYPE }}
- name: Test
shell: bash
working-directory: ${{runner.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ env.BUILD_TYPE }} -V