forked from transmission-remote-gtk/transmission-remote-gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (98 loc) · 3.3 KB
/
c-cpp.yml
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
name: C/C++ CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install deps
run: |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install meson gcc \
libgtk-3-dev \
libjson-glib-dev \
libsoup-3.0-dev \
gettext \
\
libgeoip-dev \
libappstream-dev \
appstream-util
- name: meson configure
run: meson setup build
- name: build
run: meson compile -C build
- name: dist
run: meson dist -C build
build-macos:
runs-on: macos-latest
env:
# icu4c is keg only
PKG_CONFIG_PATH: /usr/local/opt/icu4c/lib/pkgconfig
steps:
- uses: actions/checkout@v3
- name: install deps
run: |
brew install meson \
gtk+3 \
json-glib \
libsoup \
gettext\
\
geoip \
appstream-glib \
desktop-file-utils
- name: meson configure
run: meson setup build
- name: meson build
run: meson compile -C build
- name: dist
run: meson dist -C build
build-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
- name: install deps
run: |
mingw="mingw-w64-x86_64"
pacman -S --noconfirm \
git \
${mingw}-gcc \
${mingw}-meson \
${mingw}-ninja \
${mingw}-pkg-config \
\
${mingw}-gtk3 \
${mingw}-libsoup3 \
${mingw}-glib2 \
${mingw}-gettext \
${mingw}-json-glib \
\
${mingw}-appstream-glib \
${mingw}-desktop-file-utils
- uses: actions/checkout@v3
- name: configure
run: meson setup build
- name: build
run: meson compile -C build
- name: dist
run: |
# Why? Line Endings.
# actions/checkout runs as a native windows environment and wants
# to put CRLF on all lines, while msys2 looks at this and thinks
# that every single file has been changed since the line ending is
# not LF. Afterwards, `meson dist` (on msys2) will report the repo as
# dirty then fail on meson >=0.62 due to the changed default behavior
# dist fails on dirty repos. The solution to this is to just add
# `--allow-dirty` since our CI runners use the latest meson. But this
# is not the cleanest solution since we do care if the repo is dirty,
# so add a non-whitespace diff-index check before running meson-dist.
git --no-pager diff-index --quiet -b HEAD 2>/dev/null || { git --no-pager diff -b; exit 1; }
meson dist --allow-dirty -C build