summaryrefslogtreecommitdiff
path: root/.github/workflows/test-builds-on-distros.yml
blob: 4da692e2c5341a9e0de49cbec8b27d034b607ce1 (plain)
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
name: test-builds-on-distros
on:
  workflow_dispatch:    # by request
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  build:
    strategy:
      matrix:
        image: ["archlinux:base", "opensuse/tumbleweed:latest", "ubuntu:mantic", "debian:bookworm", "fedora:39"]
        cc: ["gcc", "clang"] 
        include:
        - cxx: g++
          cc: gcc
        - cxx: clang++
          cc: clang
    runs-on: ${{ (vars.LINUX_RUNNER && fromJSON(vars.LINUX_RUNNER)) || 'ubuntu-latest' }}
    container:
      image: ${{ matrix.image }}
    steps:
    - name: Install dependencies (pacman)
      if: ${{ matrix.image == 'archlinux:base' }}
      run: |
        echo arch
        echo pacman -S ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net
        pacman -Syu --noconfirm
        pacman -S --noconfirm ${{ matrix.cc }} git cmake ninja lsb-release sdl2 libpng libzip nlohmann-json tinyxml2 spdlog sdl2_net
    - name: Install dependencies (dnf)
      if: ${{ matrix.image == 'fedora:39' }}
      run: |
        echo fedora
        echo dnf install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} wget git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools tinyxml2-devel spdlog-devel
        dnf -y upgrade
        dnf -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} wget git cmake ninja-build lsb_release SDL2-devel libpng-devel libzip-devel libzip-tools tinyxml2-devel spdlog-devel
    - name: Install dependencies (apt)
      if: ${{ matrix.image == 'ubuntu:mantic' || matrix.image == 'debian:bookworm' }}
      run: |
        echo debian based
        echo apt-get install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libopengl-dev
        apt-get update
        apt-get -y full-upgrade
        apt-get -y install ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'g++') || '' }} git cmake ninja-build lsb-release libsdl2-dev libpng-dev libsdl2-net-dev libzip-dev zipcmp zipmerge ziptool nlohmann-json3-dev libtinyxml2-dev libspdlog-dev libopengl-dev
    - name: Install dependencies (zypper)
      if: ${{ matrix.image == 'opensuse/tumbleweed:latest' }}
      run: |
        echo openSUSE
        echo zypper in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
        zypper --non-interactive dup
        zypper --non-interactive in ${{ matrix.cc }} ${{ (matrix.cxx == 'g++' && 'gcc-c++') || '' }} ${{ matrix.cc == 'clang' && 'libstdc++-devel' || '' }} git cmake ninja SDL2-devel libpng16-devel libzip-devel libzip-tools nlohmann_json-devel tinyxml2-devel spdlog-devel
    - name: Install latest nlohmann
      if: ${{ matrix.image == 'fedora:39' }}
      run: |
        wget https://github.com/nlohmann/json/archive/refs/tags/v3.11.3.tar.gz
        tar -xzvf v3.11.3.tar.gz
        cd json-3.11.3
        mkdir build
        cd build
        cmake ..
        make
        sudo make install
    - uses: actions/checkout@v6
      with:
        submodules: true
    - name: Build SoH
      run: |
        export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
        cmake --no-warn-unused-cli -H. -Bbuild-cmake -GNinja -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_REMOTE_CONTROL=1
        cmake --build build-cmake --config Release -j3
      env:
        CC: ${{ matrix.cc }}
        CXX: ${{ matrix.cxx }}