aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
blob: 5309e1f467ffa517e10798e5da4e67ed31e4fdc7 (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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: CI

on: [push]

jobs:
  build:
    name: ${{matrix.config.name}}
    runs-on: ${{matrix.config.os}}
    strategy:
      fail-fast: false
      matrix:
        config:
        - {
            name: "Win32-Release",
            os: windows-latest,
            cmake_opts: "-A Win32 \
              -DALSOFT_BUILD_ROUTER=ON \
              -DALSOFT_REQUIRE_WINMM=ON \
              -DALSOFT_REQUIRE_DSOUND=ON \
              -DALSOFT_REQUIRE_WASAPI=ON",
            build_type: "Release"
          }
        - {
            name: "Win32-Debug",
            os: windows-latest,
            cmake_opts: "-A Win32 \
              -DALSOFT_BUILD_ROUTER=ON \
              -DALSOFT_REQUIRE_WINMM=ON \
              -DALSOFT_REQUIRE_DSOUND=ON \
              -DALSOFT_REQUIRE_WASAPI=ON",
            build_type: "Debug"
          }
        - {
            name: "Win64-Release",
            os: windows-latest,
            cmake_opts: "-A x64 \
              -DALSOFT_BUILD_ROUTER=ON \
              -DALSOFT_REQUIRE_WINMM=ON \
              -DALSOFT_REQUIRE_DSOUND=ON \
              -DALSOFT_REQUIRE_WASAPI=ON",
            build_type: "Release"
          }
        - {
            name: "Win64-Debug",
            os: windows-latest,
            cmake_opts: "-A x64 \
              -DALSOFT_BUILD_ROUTER=ON \
              -DALSOFT_REQUIRE_WINMM=ON \
              -DALSOFT_REQUIRE_DSOUND=ON \
              -DALSOFT_REQUIRE_WASAPI=ON",
            build_type: "Debug"
          }
        - {
            name: "Win64-UWP",
            os: windows-latest,
            cmake_opts: "-A x64 \
              -DCMAKE_SYSTEM_NAME=WindowsStore \
              \"-DCMAKE_SYSTEM_VERSION=10.0\" \
              -DALSOFT_BUILD_ROUTER=ON \
              -DALSOFT_REQUIRE_WASAPI=ON",
            build_type: "Release"
          }
        - {
            name: "macOS-Release",
            os: macos-latest,
            cmake_opts: "-DALSOFT_REQUIRE_COREAUDIO=ON",
            build_type: "Release"
          }
        - {
            name: "Linux-Release",
            os: ubuntu-latest,
            cmake_opts: "-DALSOFT_REQUIRE_RTKIT=ON \
              -DALSOFT_REQUIRE_ALSA=ON \
              -DALSOFT_REQUIRE_OSS=ON \
              -DALSOFT_REQUIRE_PORTAUDIO=ON \
              -DALSOFT_REQUIRE_PULSEAUDIO=ON \
              -DALSOFT_REQUIRE_JACK=ON \
              -DALSOFT_REQUIRE_PIPEWIRE=ON",
            deps_cmdline: "sudo apt update && sudo apt-get install -qq \
              libpulse-dev \
              portaudio19-dev \
              libasound2-dev \
              libjack-dev \
              libpipewire-0.3-dev \
              qtbase5-dev \
              libdbus-1-dev",
            build_type: "Release"
          }

    steps:
    - uses: actions/checkout@v1

    - name: Install Dependencies
      shell: bash
      run: |
        if [[ ! -z "${{matrix.config.deps_cmdline}}" ]]; then
          eval ${{matrix.config.deps_cmdline}}
        fi

    - name: Configure
      shell: bash
      run: |
        cmake -B build -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} ${{matrix.config.cmake_opts}} .

    - name: Build
      shell: bash
      run: |
        cmake --build build --config ${{matrix.config.build_type}}

    - name: Create Archive
      if: ${{ matrix.config.os == 'windows-latest' }}
      shell: bash
      run: |
        cd build
        mkdir archive
        mkdir archive/router
        cp ${{matrix.config.build_type}}/soft_oal.dll archive
        cp ${{matrix.config.build_type}}/OpenAL32.dll archive/router

    - name: Upload Archive
      # Upload package as an artifact of this workflow.
      uses: actions/upload-artifact@v3.1.1
      if: ${{ matrix.config.os == 'windows-latest' }}
      with:
        name: soft_oal-${{matrix.config.name}}
        path: build/archive