forked from diffkemp/diffkemp
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (94 loc) · 3.58 KB
/
builds.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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: release
diffkemp-bin: diffkemp
- build-type: development
diffkemp-bin: build/bin/diffkemp
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- 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
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
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