Skip to content

Commit

Permalink
use conan2, fix plt bug and warning fix, test workflow (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
partouf authored Oct 23, 2024
1 parent 4bba213 commit 7fd3714
Show file tree
Hide file tree
Showing 13 changed files with 749 additions and 43 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,45 +9,47 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 1.59.0
version: 2.8.1

- name: Configure conan
run: |
conan profile new default --detect
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile detect
sed -i 's/compiler\.cppstd=.*/compiler.cppstd=20/g' ~/.conan2/profiles/default
conan install --build=fmt/11.0.0 .
- name: Build
run: |
mkdir build
CURDIR=$PWD
mkdir -p build
cd build
cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel $(nproc)
cmake "-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=$CURDIR/conan_provider.cmake" -DCMAKE_C_COMPILER=/usr/bin/gcc-10 -DCMAKE_CXX_COMPILER=/usr/bin/g++-10 -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
- name: Unit test
run: |
cd build && ctest -V
cd build/src/test && ./asm-parser-test
- name: Smoke test
run: |
$GITHUB_WORKSPACE/build/bin/asm-parser $GITHUB_WORKSPACE/resources/example_intel.asm > ./example_intel.json
$GITHUB_WORKSPACE/build/src/asm-parser $GITHUB_WORKSPACE/resources/example_intel.asm > ./example_intel.json
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
path: build/bin/asm-parser
path: build/src/asm-parser

- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_COMPRESS: xz
GHR_PATH: build/bin/
GHR_PATH: build/src/
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 0 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,6 @@ check_ipo_supported()
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_DEBUG FALSE)

if (NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.16.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
TLS_VERIFY ON)
endif ()

include(${CMAKE_BINARY_DIR}/conan.cmake)

conan_check(VERSION 1.43.1 REQUIRED)

conan_cmake_run(
REQUIRES
catch2/2.13.7
approvaltests.cpp/10.12.0
fmt/9.1.0
ctre/3.7.1
BASIC_SETUP
BUILD missing)

include(${CMAKE_BINARY_DIR}/conan.cmake)

enable_testing()

add_subdirectory(src)
15 changes: 15 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

PATH=/opt/compiler-explorer/cmake/bin:/opt/compiler-explorer/ninja:$PWD/.venv/bin:$PATH

rm -Rf build
mkdir build
cmake -B build -G Ninja -S . -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=./conan_provider.cmake -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug

CURDIR=$PWD

cd build/src
test/asm-parser-test

cd $PWD
Loading

0 comments on commit 7fd3714

Please sign in to comment.