fix macOS CI #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |