Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a config to build and run on PRs. #213

Merged
merged 1 commit into from
Jul 18, 2024
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
Add a config to build and run on PRs.
Currently the CI config targets 22.04 with tests being run for the LLVM
tools built with clang. We also build GCOV tools built with GCC but do
not test them yet since a couple of tests are failing.

Also fix the commit hash check.
  • Loading branch information
snehasish committed Jul 18, 2024
commit 5b530c9a8f358a5c232b8af39390e576890b0c63
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: autofdo CI

on:
push:
branches: [ $default-branch ]
pull_request:
types: [opened, reopened, synchronize]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this trigger CI when user updates his PR? (Do we also want "edited"?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Assuming by update you mean adding more commits I think that is covered by synchronize. Edited covers the cases where title, description or base branch is edited [1]. Let me know if you still think it's worth adding the edited.

[1] https://frontside.com/blog/2020-05-26-github-actions-pull_request/


# Manual trigger using the Actions page.
workflow_dispatch:

defaults:
run:
shell: bash

jobs:
build:

runs-on: ubuntu-22.04-8core

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: install dependencies
run: sudo apt-get -y install libunwind-dev libgflags-dev libssl-dev libelf-dev protobuf-compiler libzstd-dev

- name: cmake for llvm
run: cmake -DENABLE_TOOL=LLVM -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -B build-llvm
- name: build for llvm
run: make -j 8 -C build-llvm
- name: run tests for llvm
run: make test -C build-llvm

- name: cmake for gcov
run: cmake -DENABLE_TOOL=GCOV -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -B build-gcov
- name: build for gcov
run: make -j 8 -C build-gcov

4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ function (build_gcov)
endfunction()

function (build_llvm)
execute_process(COMMAND sh -c "git -C ${CMAKE_HOME_DIRECTORY}/third_party/llvm-project log -1 --format=%h"
execute_process(COMMAND sh -c "git -C ${CMAKE_HOME_DIRECTORY}/third_party/llvm-project log -1 --format=%H"
RESULT_VARIABLE clang_version_status
OUTPUT_VARIABLE CLANG_VERSION_OUTPUT)

set(CLANG_KNOWN_GIT_COMMIT_HASH "e4f9175d2395")
set(CLANG_KNOWN_GIT_COMMIT_HASH "e4f9175d23950ecaef32db075ed47dafe3be555c")
if (clang_version_status)
message(WARNING "Could not get clang commit hash : Use clang git hash " ${CLANG_KNOWN_GIT_COMMIT_HASH})
else()
Expand Down