Skip to content

[CI] Add checks for compiler course (spring 2024) #3

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

Merged
merged 3 commits into from
Feb 11, 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
109 changes: 109 additions & 0 deletions .github/workflows/nn-cmplr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build LLVM
on: [push, pull_request]

jobs:
ubuntu-gcc-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup environment
run: |
sudo apt-get install -y \
build-essential \
ninja-build \
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: 500M
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S llvm -B build \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS='clang;mlir' \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-G Ninja
cmake --build build -j $(nproc)
- name: Test
run: |
cmake --build build -t check-llvm check-clang check-mlir -j $(nproc)
macos-build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup environment
run: |
brew install \
ninja
- name: Setup ccache
uses: hendrikmuhs/[email protected]
with:
max-size: 500M
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S llvm -B build \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS='clang;mlir' \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-G Ninja
cmake --build build -j $(nproc)
- name: Test
run: |
cmake --build build -t check-llvm check-clang check-mlir -j $(nproc)
windows-build:
runs-on: windows-latest
steps:
- name: Setup Windows
if: startsWith(matrix.os, 'windows')
uses: llvm/actions/setup-windows@main
with:
arch: amd64
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python_version }}
- name: Install Ninja
uses: llvm/actions/install-ninja@main
- uses: actions/checkout@v4
with:
fetch-depth: 250
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
# A full build of llvm, clang, lld, and lldb takes about 250MB
# of ccache space. There's not much reason to have more than this,
# because we usually won't need to save cache entries from older
# builds. Also, there is an overall 10GB cache limit, and each
# run creates a new cache entry so we want to ensure that we have
# enough cache space for all the tests to run at once and still
# fit under the 10 GB limit.
# Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
max-size: 2G
key: ${{ matrix.os }}
variant: sccache
- name: Build and Test
shell: bash
id: build-llvm
run: |
builddir="$(pwd)"/build
echo "llvm-builddir=$builddir" >> "$GITHUB_OUTPUT"
cmake -G Ninja \
-B "$builddir" \
-S llvm \
-DLLVM_ENABLE_PROJECTS="clang" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLDB_INCLUDE_TESTS=OFF \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
${{ inputs.extra_cmake_args }}
ninja -C "$builddir" all
44 changes: 44 additions & 0 deletions .github/workflows/nn-cmplr-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Static analysis

on: [pull_request]

jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get install -y clang-format
- name: Run clang-format
run: |
git-clang-format --diff `git merge-base ${GITHUB_SHA} ${GITHUB_BASE_REF}`
clang-tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Update submodules
run: git submodule update --init --recursive
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ github.job }}
- uses: ZedThree/[email protected]
id: review
with:
build_dir: build
cmake_command: cmake -S llvm -B build
-DCMAKE_BUILD_TYPE=Release
-DLLVM_ENABLE_PROJECTS='clang;mlir'
-DLLVM_ENABLE_ASSERTIONS=ON
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-G Ninja
config_file: .clang-tidy
apt_packages: build-essential,ninja-build
split_workflow: true
env:
CC: clang-16
CXX: clang++-16
3 changes: 3 additions & 0 deletions llvm/test/tools/opt-viewer/lit.local.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ if "have_opt_viewer_modules" not in config.available_features:
# can be resolved.
if sys.platform == "win32":
config.unsupported = True

if sys.platform == "darwin":
config.unsupported = True