tmp #102
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: Builds | |
on: [push, pull_request] | |
env: | |
llvm: 17 | |
jobs: | |
nix-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v10 | |
- uses: DeterminateSystems/magic-nix-cache-action@v4 | |
- name: Build using nix | |
run: nix build | |
- name: Run built Diffkemp | |
run: result/bin/diffkemp --help | |
local-build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- build-type: development | |
diffkemp-bin: build/bin/diffkemp | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Install Dependencies | |
run: | | |
sudo apt update | |
sudo apt install cmake ninja-build libgtest-dev python3-cffi | |
- 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/jammy/ llvm-toolchain-jammy-${{ env.llvm }} main" | |
sudo apt update | |
sudo apt install llvm-${{ env.llvm }}-dev clang-${{ env.llvm }} | |
sudo ln -s /usr/lib/llvm-${{ env.llvm }} /usr/local/lib/llvm | |
ls "/usr/lib/llvm-${{ env.llvm }}/bin" | |
echo "/usr/lib/llvm-${{ env.llvm }}/bin" >> $GITHUB_PATH | |
echo $GITHUB_PATH | |
- name: Release build and install of DiffKemp | |
if: ${{ matrix.build-type == 'release' }} | |
run: | | |
echo $PATH | |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Release | |
echo $PATH | |
sudo ninja -C build install | |
pip install . | |
# No need to install binary with python build | |
# sudo install -m 0755 bin/diffkemp /usr/bin/diffkemp | |
- name: Development build of DiffKemp | |
if: ${{ matrix.build-type == 'development' }} | |
run: | | |
echo $PATH | |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Debug | |
echo $PATH | |
sudo ninja -C build | |
pip install -e . | |
- name: Check by building and comparing make-based project | |
run: | | |
${{matrix.diffkemp-bin}} build tests/testing_projects/make_based/ old-snapshot | |
${{matrix.diffkemp-bin}} build tests/testing_projects/make_based/ new-snapshot | |
${{matrix.diffkemp-bin}} compare old-snapshot new-snapshot | |
nix-development-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: DeterminateSystems/nix-installer-action@v10 | |
- uses: DeterminateSystems/magic-nix-cache-action@v4 | |
- name: Build DiffKemp | |
run: > | |
nix develop . --command bash -c | |
"pip install cffi && | |
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=Debug && | |
ninja -C build" | |
- name: Check by building and comparing make-based project | |
run: > | |
nix develop . --command bash -c | |
"pwd && ls && cat build/bin/diffkemp && | |
build/bin/diffkemp build tests/testing_projects/make_based/ old-snapshot && | |
build/bin/diffkemp build tests/testing_projects/make_based/ new-snapshot && | |
build/bin/diffkemp compare old-snapshot new-snapshot" | |
cc-wrapper-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pip3 backup | |
run: python3 -m pip install pip -U | |
- name: RPython installation | |
run: | | |
sudo apt install python2 python-pip | |
python2 -m pip install rpython | |
- name: Build cc-wrapper to binary | |
run: python2 -m rpython ${{ github.workspace }}/diffkemp/building/cc_wrapper.py |