summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/.github/workflows/main.yml
blob: 63772b046eeba8b0ceb5b681b2ea72db65e7cbea (plain) (blame)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
name: CI

concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

on:
  push:
  pull_request:

jobs:
  msvc:
    strategy:
      fail-fast: true
      matrix:
        include: [
          { config: Debug, platform: Win32, bindir: 'win32_vs2019' },
          { config: Debug, platform: x64, bindir: 'win64_vs2019' },
          { config: Release, platform: Win32, bindir: 'win32_vs2019' },
          { config: Release, platform: x64, bindir: 'win64_vs2019' },
        ]
    name: msvc-${{ matrix.config }}-${{ matrix.platform }}
    runs-on: windows-2019
    steps:
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Prepare
        uses: microsoft/setup-msbuild@v1.1
      - name: Build
        shell: cmd
        run: |
          cd bgfx
          ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019
          msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
      - name: Check
        shell: cmd
        run: |
          cd bgfx
          dir /s ".build\${{ matrix.bindir }}\bin"
          ".build\${{ matrix.bindir }}\bin\geometryc${{ matrix.config }}.exe" --version
          ".build\${{ matrix.bindir }}\bin\shaderc${{ matrix.config }}.exe" --version
          ".build\${{ matrix.bindir }}\bin\texturec${{ matrix.config }}.exe" --version
  mingw:
    strategy:
      fail-fast: true
      matrix:
        include: [
          { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' },
          { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' },
        ]
    name: mingw-${{ matrix.msystem }}
    runs-on: windows-latest
    steps:
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Prepare
        uses: msys2/setup-msys2@v2
        with:
          msystem: ${{ matrix.msystem }}
          update: true
          install: make
          pacboy: cc:p
      - name: Build
        shell: msys2 {0}
        run: |
          cd bgfx
          make ${{ matrix.project }}-release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX
      - name: Check
        shell: cmd
        run: |
          cd bgfx
          dir /s ".build\${{ matrix.bindir }}\bin"
          ".build\${{ matrix.bindir }}\bin\geometrycRelease.exe" --version
          ".build\${{ matrix.bindir }}\bin\shadercRelease.exe" --version
          ".build\${{ matrix.bindir }}\bin\texturecRelease.exe" --version
  linux:
    strategy:
      fail-fast: true
      matrix:
        include: [
          { config: debug, binsuffix: Debug },
          { config: release, binsuffix: Release },
        ]
    name: linux-${{ matrix.config }}64
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Build
        run: |
          sudo apt install libgl-dev
          cd bgfx
          make -j$(nproc) linux-${{ matrix.config }}64
      - name: Check
        run: |
          cd bgfx
          ls -lash ".build/linux64_gcc/bin"
          ".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version
          ".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version
          ".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version
  wasm:
    strategy:
      fail-fast: true
      matrix:
        config: [ debug, release]
    name: wasm-${{ matrix.config }}
    runs-on: ubuntu-22.04
    steps:
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Prepare
        run: |
          docker pull emscripten/emsdk
          docker run --rm emscripten/emsdk which emcc em++ emar
          cd bgfx
          EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake
      - name: Build
        run: >
          docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk
          make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten
      - name: Check
        run: |
          cd bgfx
          ls -lash ".build/wasm/bin"
  osx:
    strategy:
      fail-fast: true
      matrix:
        include: [
          { config: debug, binsuffix: Debug },
          { config: release, binsuffix: Release },
        ]
    name: osx-x64-${{ matrix.config }}
    runs-on: macos-latest
    steps:
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Build
        run: |
          cd bgfx
          make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }}
      - name: Check
        run: |
          cd bgfx
          ls -lash ".build/osx-x64/bin"
          ".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version
          ".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version
          ".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version
  android:
    strategy:
      fail-fast: true
      matrix:
        include: [
          { platform: arm    },
          { platform: arm64  },
          { platform: x86    },
          { platform: x86_64 },
        ]
    name: android-${{ matrix.platform }}
    runs-on: ubuntu-22.04
    steps:
      - uses: nttld/setup-ndk@v1
        id: setup-ndk
        with:
          ndk-version: r25b
          add-to-path: false
      - name: Checkout bgfx
        uses: actions/checkout@v3
        with:
          path: bgfx
      - name: Checkout bx
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bx
          path: bx
      - name: Checkout bimg
        uses: actions/checkout@v3
        with:
          repository: bkaradzic/bimg
          path: bimg
      - name: Build
        run: |
          cd bgfx
          make -j$(sysctl -n hw.physicalcpu) android-${{ matrix.platform }}
        env:
          ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
      - name: Check
        run: |
          cd bgfx
          ls -lash ".build/android-${{ matrix.platform }}/bin"