-
-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (65 loc) · 2.98 KB
/
Linux.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
name: Midgard - Linux
on: [push, pull_request]
jobs:
linux:
name: Linux (${{ matrix.compiler.c }}, ${{ matrix.build_type }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
compiler:
- { c: gcc, cpp: g++ }
- { c: clang, cpp: clang++ }
build_type:
- Debug
- Release
steps:
- uses: actions/checkout@v3
- name: Pulling RaZ
run: git submodule update --init --recursive
# Updating the packages list (needed at the moment for libinput to be found), & installing the needed packages for RaZ:
# - GLEW & X11 as graphical dependencies
# - OpenAL-soft to handle the audio part
- name: Packages installation
run: |
sudo apt update &&
sudo apt install -y --no-install-recommends \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
libopenal-dev
- name: Build setup
run: |
cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DMIDGARD_BUILD_RAZ=ON \
$GITHUB_WORKSPACE
- name: Build
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake --build . --config ${{ matrix.build_type }} &&
pwd && find .
# Installing Midgard in the build directory; default is /usr/local
- name: Install
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
sudo cmake --install . --prefix ./ --config ${{ matrix.build_type }}
# Making an archive to maintain file permissions & avoiding weird paths
# Additional dependencies are libc & libm (located in /usr/lib*), as well as libgcc_s & libstdc++ (which would require another package)
- name: Packaging build
run: |
mkdir Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}/ &&
cp -t Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}/ \
${{ runner.workspace }}/build-${{ matrix.compiler.c }}/Midgard \
/usr/lib/*/libGL.so \
/usr/lib/*/libopenal.so
tar -cvf Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}.tar \
Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}/
- name: Upload build
uses: actions/upload-artifact@v3
with:
name: Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: Midgard-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}.tar