Skip to content

Commit d5d236e

Browse files
committed
ci: add alpine Ci, to build under musl
1 parent a88c9dc commit d5d236e

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/musl.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: musl CI
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
name: ${{ matrix.config.name }}
12+
runs-on: ubuntu-24.04
13+
container: alpine:3.20
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
config:
19+
- name: Linux (musl)
20+
use-clang: false
21+
22+
- name: Linux Clang (musl, libstdc++)
23+
use-clang: true
24+
use-clang_stdlib: false
25+
26+
- name: Linux Clang (musl, libc++)
27+
use-clang: true
28+
use-clang_stdlib: true
29+
30+
31+
steps:
32+
- name: Install dependencies
33+
run: |
34+
apk update
35+
apk add wget meson ca-certificates samurai git openssl-dev openssl pkgconf sdl2 sdl2-dev sdl2_mixer-dev sdl2_ttf-dev sdl2_mixer-dev sdl2_image-dev ${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) && 'clang18' || 'gcc g++' }} ${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) && 'libc++' || '' }}
36+
echo "CC=${{ matrix.config.use-clang == true && 'clang18' || 'gcc' }}" >> "$GITHUB_ENV"
37+
echo "CXX=${{ matrix.config.use-clang == true && 'clang++-18' || 'g++' }}" >> "$GITHUB_ENV"
38+
39+
- uses: actions/checkout@v4
40+
with:
41+
fetch-depth: '0'
42+
43+
- name: Configure
44+
run: meson setup build -Dbuildtype=release -Ddefault_library=shared -Dclang_libcpp=${{ ( matrix.config.use-clang == true && matrix.config.use-clang_stdlib ) && 'enabled' || 'disabled' }}
45+
46+
- name: Build
47+
run: meson compile -C build
48+
49+
- name: Upload artifacts
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: ${{ matrix.config.name }} Executable
53+
path: build/src/executables/oopetris*

0 commit comments

Comments
 (0)