make the installer a Meson target #415
Workflow file for this run
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
# Copyright (c) 2022-2024 Guilherme Janczak <[email protected]> | |
# | |
# Permission to use, copy, modify, and distribute this software for any | |
# purpose with or without fee is hereby granted, provided that the above | |
# copyright notice and this permission notice appear in all copies. | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
name: 'Build and Test' | |
on: [push, pull_request] | |
# GitHub Actions doesn't support YAML anchors, so there's a lot of code | |
# copypasted between jobs. You'll probably want to read the 'glibc:' task first, | |
# it's the one that requires the least hacks. | |
jobs: | |
bionic: | |
# XXX: Checkout and upload actions don't work, work with termux to fix this | |
# and the need to run /entrypoint.sh ourselves. | |
runs-on: ubuntu-latest | |
container: termux/termux-docker:x86_64 | |
steps: | |
- name: setup | |
run: | | |
/entrypoint.sh pkg install -y ninja clang python git | |
/entrypoint.sh pip install meson | |
git clone --depth 1 -b $GITHUB_REF_NAME \ | |
https://github.com/$GITHUB_REPOSITORY | |
- name: build | |
run: | | |
meson setup build dictpw | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
dietlibc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup | |
run: | | |
pip install meson | |
sudo apt update | |
sudo apt install -y dietlibc-dev linux-headers-generic ninja-build \ | |
valgrind | |
- uses: actions/[email protected] | |
- name: build | |
run: | | |
CC='diet gcc' meson setup build -Ddefault_library=static | |
meson compile -C build | |
- name: test | |
run: meson test -C build --wrapper valgrind | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-dietlibc | |
path: build/meson-logs | |
emscripten: | |
runs-on: macos-latest | |
steps: | |
- name: setup | |
run: | | |
brew update | |
brew install meson samurai emscripten | |
- uses: actions/[email protected] | |
- name: build | |
run: | | |
meson setup build -Ddefault_library=static \ | |
--cross-file=.github/workflows/meson-emscripten.txt | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-emscripten | |
path: build/meson-logs | |
glibc: | |
runs-on: ubuntu-latest | |
steps: | |
- name: setup | |
run: | | |
pip install meson | |
sudo apt update | |
sudo apt install -y ninja-build | |
- uses: actions/[email protected] | |
- name: build | |
run: | | |
meson setup build | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-glibc | |
path: build/meson-logs | |
haiku: | |
runs-on: ubuntu-22.04 | |
container: 'docker.io/hectorm/qemu-haiku:latest' | |
steps: | |
# Copied from: https://github.com/hectorm/docker-qemu-haiku#github-actions | |
# Notice I changed make to meson in the 'Install packages' step. | |
- name: 'Wait until the VM is ready' | |
run: 'container-init & timeout 600 vmshell exit 0' | |
- name: 'Install packages' | |
run: 'vmshell pkgman install -y meson gcc haiku_devel' | |
- name: 'Checkout project' | |
uses: 'actions/checkout@main' | |
- name: 'Copy project to VM' | |
run: 'vmshell mkdir ./src/; tar -cf - ./ | vmshell tar -xf - -C ./src/' | |
# Now the rest is much of the same old. | |
- name: build | |
run: | | |
vmshell meson setup build src | |
vmshell meson compile -C build | |
- name: test | |
run: vmshell meson test -C build | |
- name: copy falure logs | |
if: always() | |
run: | | |
vmshell tar -cf - build/meson-logs | tar -xf - | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-haiku | |
path: build/meson-logs | |
macos: | |
runs-on: macos-latest | |
steps: | |
- run: | | |
brew update | |
brew install meson samurai | |
- uses: actions/[email protected] | |
- name: build | |
run: | | |
meson setup build | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-macos | |
path: build/meson-logs | |
msys2: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
strategy: | |
matrix: | |
# clang32 was broken last time I tried | |
sys: [msys, mingw64, mingw32, ucrt64, clang64] | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: ${{matrix.sys}} | |
path-type: strict | |
pacboy: | | |
gcc:p meson:p ninja:p dos2unix: git: groff: | |
# Some environments have no nsis, so we use mingw-w64's. | |
- name: env-lacks-nsis | |
if: matrix.sys == 'msys' || matrix.sys == 'clang64' | |
run: pacman -S --noconfirm --needed mingw-w64-x86_64-nsis | |
- name: env-has-nsis | |
if: matrix.sys != 'msys' && matrix.sys != 'clang64' | |
run: pacboy -S --noconfirm --needed nsis:p | |
- uses: actions/[email protected] | |
- name: build | |
run: | | |
if [ "$MSYSTEM" = "MSYS" ] || [ "$MSYSTEM" = "CLANG64" ]; then | |
PATH="${PATH}:/mingw64/bin" | |
fi | |
meson setup build | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
- name: installer | |
run: | | |
meson compile installer -C build | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-${{matrix.sys}} | |
path: build/meson-logs | |
- uses: actions/[email protected] | |
if: success() | |
with: | |
name: setup-${{matrix.sys}} | |
path: build/setup-dictpw.exe | |
netbsd: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
- name: test on NetBSD | |
uses: cross-platform-actions/[email protected] | |
with: | |
operating_system: netbsd | |
version: '9.3' | |
run: | | |
sudo pkgin -y install meson git mozilla-rootcerts-openssl | |
meson setup build | |
meson compile -C build | |
meson test -C build | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-netbsd | |
path: build/meson-logs | |
vs: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
cc: [cl, clang-cl] | |
arch: [x64, ARM64] | |
steps: | |
- uses: actions/[email protected] | |
- run: | | |
pip install meson | |
choco install ninja nsis groff -y | |
- uses: actions/[email protected] | |
- name: Enable ARM64 Developer Command Prompt | |
if: matrix.arch == 'ARM64' | |
uses: ilammy/[email protected] | |
with: | |
arch: amd64_arm64 | |
- name: Enable x64 Developer Command Prompt | |
if: matrix.arch == 'x64' | |
uses: ilammy/[email protected] | |
- name: build | |
run: | | |
if ("${{matrix.arch}}" -eq 'ARM64') { | |
$buildcc = "--native-file=.github/workflows/meson-vs-gcc.txt" | |
$hostarch = "--cross-file=.github/workflows/meson-vs-aarch64.txt" | |
$hostcc = "--cross-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | |
# clang-cl needs extra args to target a particular architecture. | |
$hostcc_args = if (${{matrix.cc}} -eq 'clang-cl') { | |
"--cross-file=.github/workflows/meson-vs-clang-cl-aarch64.txt" | |
} | |
} else { | |
$hostcc = "--native-file=.github/workflows/meson-vs-${{matrix.cc}}.txt" | |
} | |
# Don't do debug builds because that triggers a Windows bug: | |
# https://developercommunity.visualstudio.com/t/_setmaxstdio-hangs-the-program-if-the/10164855?space=62&q=setmaxstdio&viewtype=all | |
meson setup build -Dbuildtype=release ` | |
-Db_vscrt=static_from_buildtype ` | |
$buildcc $hostarch $hostcc $hostcc_args | |
meson compile -C build | |
- name: test | |
run: meson test -C build | |
- name: inst | |
run: | | |
meson compile installer -C build | |
ls -R build/ | |
- uses: actions/[email protected] | |
if: always() | |
with: | |
name: meson-logs-vs-${{matrix.cc}}-${{matrix.arch}} | |
path: build/meson-logs | |
- uses: actions/[email protected] | |
if: success() | |
with: | |
name: setup-vs-${{matrix.cc}}-${{matrix.arch}} | |
path: build/setup-*.exe |