Use make cscope #202
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Check space | |
run: df -h | |
- name: Run Regression Tests | |
if: matrix.regression-tests | |
working-directory: ${{ github.workspace }} | |
run: | | |
pytest tests | |
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 | |