Repository navigation
105 lines (94 loc) · 3.99 KB
/
Copy pathci.yml
File metadata and controls
105 lines (94 loc) · 3.99 KB
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
name: CI
# Builds and runs the tests on a push to main and on manual dispatch, after the workflow of
# stdcorelib. workflow_dispatch repeats a run without a push.
on:
push:
branches: [ main ]
workflow_dispatch:
jobs:
# One configuration for each platform, and the shared library once for each way of exporting:
# visibility on ELF, __declspec of MSVC here, and __declspec of the GNU front end in the job
# mingw. HelloUtau links the static library.
build:
name: ${{ matrix.platform }} ${{ matrix.config }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { platform: linux-gcc, os: ubuntu-latest, cc: gcc, cxx: g++, config: static }
- { platform: linux-clang, os: ubuntu-latest, cc: clang, cxx: clang++, config: shared-release }
- { platform: macos, os: macos-latest, cc: clang, cxx: clang++, config: static }
- { platform: windows-msvc, os: windows-latest, cc: cl, cxx: cl, config: static }
- { platform: windows-msvc, os: windows-latest, cc: cl, cxx: cl, config: shared }
- { platform: windows-clang-cl, os: windows-latest, cc: clang-cl, cxx: clang-cl, config: release }
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- name: Settings for this configuration
id: cfg
shell: bash
run: |
case "${{ matrix.config }}" in
static) flags="-DSTDUTAU_BUILD_STATIC=ON"; type=Debug ;;
shared) flags="-DSTDUTAU_BUILD_STATIC=OFF"; type=Debug ;;
release) flags="-DSTDUTAU_BUILD_STATIC=ON"; type=Release ;;
shared-release) flags="-DSTDUTAU_BUILD_STATIC=OFF"; type=Release ;;
esac
# The oldest macOS that the library supports, which lacks the floating-point
# std::to_chars of libc++. Without a deployment target, the target is the SDK version,
# and a function unavailable on the oldest supported macOS compiles.
if [ "${{ runner.os }}" = macOS ]; then
flags="$flags -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0"
fi
echo "flags=$flags" >> "$GITHUB_OUTPUT"
echo "type=$type" >> "$GITHUB_OUTPUT"
- name: Configure
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
cmake -G Ninja -S . -B build \
-DCMAKE_BUILD_TYPE=${{ steps.cfg.outputs.type }} \
-DSTDUTAU_BUILD_TESTS=ON \
${{ steps.cfg.outputs.flags }}
- name: Build
run: cmake --build build
# --no-tests=error, because ctest succeeds if it finds no test.
- name: Test
run: ctest --test-dir build --output-on-failure --no-tests=error
# MinGW with the LLVM toolchain of the CLANG64 environment of MSYS2: clang, lld, libc++ and the
# UCRT, as llvm-mingw, with which HelloUtau builds its MinGW variant. The MinGW headers differ
# from those of the Windows SDK, and a library of the GNU front end with dllexport differs from
# one of MSVC.
mingw:
name: windows-mingw-clang ${{ matrix.config }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
config: [ static, shared ]
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: CLANG64
update: false
install: >-
mingw-w64-clang-x86_64-clang
mingw-w64-clang-x86_64-cmake
mingw-w64-clang-x86_64-ninja
mingw-w64-clang-x86_64-boost
- name: Build
shell: msys2 {0}
run: |
case "${{ matrix.config }}" in
static) flags="-DSTDUTAU_BUILD_STATIC=ON" ;;
shared) flags="-DSTDUTAU_BUILD_STATIC=OFF" ;;
esac
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Debug -DSTDUTAU_BUILD_TESTS=ON $flags
cmake --build build
- name: Test
shell: msys2 {0}
run: ctest --test-dir build --output-on-failure --no-tests=error