Skip to content

Commit

Permalink
[feat] add github action build-ubuntu workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shenjunjiekoda committed Sep 4, 2024
1 parent 7e9c107 commit 5754321
Show file tree
Hide file tree
Showing 11 changed files with 652 additions and 14 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build on Ubuntu
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-ubuntu:
runs-on: ubuntu-24.04
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install Dependencies
run: |
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble main" | sudo tee /etc/apt/sources.list.d/llvm.list
echo "deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
echo "deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-18 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
echo "deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --yes \
gcc g++ cmake libgmp-dev libedit-dev \
python3 python3-pip \
llvm-18 llvm-18-dev llvm-18-tools clang-18 libclang-18-dev
- name: Spell Check
uses: crate-ci/[email protected]

- name: Clang Format
run: |
chmod +x scripts/run-clang-format
scripts/run-clang-format
- name: Build Repo
run: |
cmake -DCMAKE_BUILD_TYPE:STRING=Release -DLINK_LLVM_DYLIB=ON -DCMAKE_C_COMPILER:STRING=/usr/bin/gcc -DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++ -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_INSTALL_PREFIX="/opt/knight" -DLLVM_BUILD_DIR="/usr/lib/llvm-18" -B build
cmake --build build -j16
cmake --install build
echo $(pwd)/build/bin >> $GITHUB_PATH
- name: Test Binary
run: |
knight --help
- name: Unit Tests
run: |
pwd
chmod +x scripts/unittest
scripts/unittest run test/testcase/
2 changes: 1 addition & 1 deletion include/dfa/domain/dom_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ get_domain_bottom_val_fn(DomID id) {
template < typename Derived >
class AbsDom : public AbsDomBase {
public:
AbsDom< Derived >() : AbsDomBase(Derived::get_kind()) {}
AbsDom() : AbsDomBase(Derived::get_kind()) {}

void join_with(const AbsDomBase& other) override {
static_assert(does_derived_dom_can_join_with< Derived >::value,
Expand Down
2 changes: 1 addition & 1 deletion include/dfa/domain/map/map_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class MapDom : public AbsDom< MapDom< Key, SeparateValue, domain_kind > > {
} else if (value.is_top()) {
this->forget(key);
} else {
this->m_table.insert_or_assign(key, value);
this->m_table[key] = value;
}
}

Expand Down
2 changes: 1 addition & 1 deletion include/dfa/domain/map/separate_numerical_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class SeparateNumericalDom
} else if (value.is_top()) {
this->forget(key);
} else {
this->m_table.insert_or_assign(key, value);
this->m_table[key] = value;
}
}

Expand Down
Empty file.
Loading

0 comments on commit 5754321

Please sign in to comment.