Skip to content

Format

Format #198

Workflow file for this run

name: CI
on: [push, pull_request]
env:
KERNELS: >
3.10.0-514.el7
3.10.0-693.el7
3.10.0-862.el7
3.10.0-957.el7
4.18.0-80.el8
4.18.0-147.el8
4.18.0-193.el8
4.18.0-240.el8
3.10
4.11
jobs:
build-and-test:
runs-on: ubuntu-20.04
strategy:
matrix:
llvm: [9, 10, 11, 12, 13, 14, 15, 16]
env:
- CC: gcc-9
CXX: g++-9
asan: [OFF]
regression-tests: [true]
include:
- llvm: 16
env:
CC: clang
CXX: clang++
asan: OFF
regression-tests: true
- llvm: 14
env:
CC: gcc-9
CXX: g++-9
asan: ON
regression-tests: false
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
working-directory: ${{ github.workspace }}
shell: bash
run: |
sudo apt-get install bc cscope gcc-7 libelf-dev ninja-build
pip install -r requirements.txt
- name: Install LLVM
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main"
sudo apt-get update
sudo apt-get install llvm-${{ matrix.llvm }} llvm-${{ matrix.llvm }}-dev clang-${{ matrix.llvm }}
sudo ln -s /usr/lib/llvm-${{ matrix.llvm }} /usr/local/lib/llvm
echo "/usr/lib/llvm-${{ matrix.llvm }}/bin" >> $GITHUB_PATH
- name: Set GCC Version for Kernel Builds
if: matrix.regression-tests
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 100
- name: Cache Linux Kernels
if: matrix.regression-tests
id: kernel-cache
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/kernel
key: kernels-${{ env.KERNELS }}
- name: Obtain Linux Kernels
if: steps.kernel-cache.outputs.cache-hit != 'true' && matrix.regression-tests
working-directory: ${{ github.workspace }}
run: |
mkdir -p ${{ github.workspace }}/kernel
git clone https://github.com/viktormalik/rhel-kernel-get.git
pip3 install -r rhel-kernel-get/requirements.txt
for k in $KERNELS; do
rhel-kernel-get/rhel-kernel-get.py $k --output-dir kernel
done
- name: Clean Linux Kernels
if: steps.kernel-cache.outputs.cache-hit == 'true' && matrix.regression-tests
working-directory: ${{ github.workspace }}/kernel
run: find -name *.ll -delete
- name: Prepare Build Environment
run: |
mkdir -p ${{ github.workspace }}/build
- name: CMake
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}/build
shell: bash
run: cmake $GITHUB_WORKSPACE -GNinja -DSANITIZE_ADDRESS=${{ matrix.asan }}
- name: Build
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}/build
run: ninja
- name: Install
env: ${{ matrix.env }}
working-directory: ${{ github.workspace }}
run: pip3 install -e .
- name: Run Unit Tests
working-directory: ${{ github.workspace }}
run: |
tests/unit_tests/simpll/runTests
- name: Run Regression Tests
if: matrix.regression-tests
working-directory: ${{ github.workspace }}
run: |
pytest tests -v -k test_build_cscope_database
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
working-directory: ${{ github.workspace }}
shell: bash
run: |
sudo apt-get install clang-format
pip install flake8
- name: Check Coding Style
working-directory: ${{ github.workspace }}
shell: bash
run: |
flake8 diffkemp --exclude=llreve --ignore=F403,F405,W504
flake8 tests
tools/check-clang-format.sh -d
cscope-bug:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
working-directory: ${{ github.workspace }}
shell: bash
run: |
sudo apt-get install bc cscope gcc-7 libelf-dev ninja-build
pip install -r requirements.txt
- name: Install LLVM
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main"
sudo apt-get update
sudo apt-get install llvm-14 llvm-14-dev clang-14
sudo ln -s /usr/lib/llvm-14 /usr/local/lib/llvm
echo "/usr/lib/llvm-14/bin" >> $GITHUB_PATH
- name: Obtain Linux Kernel
working-directory: ${{ github.workspace }}
run: |
mkdir -p ${{ github.workspace }}/kernel
git clone https://github.com/viktormalik/rhel-kernel-get.git
pip3 install -r rhel-kernel-get/requirements.txt
rhel-kernel-get/rhel-kernel-get.py 3.10 --output-dir kernel
- name: Inspect Cscope bug
working-directory: ${{ github.workspace }}
run: |
mv cscope.files kernel/linux-3.10
cd kernel/linux-3.10
cscope -b -q -k
ls -aihl
rm cscope.*