Added pre-build.yml #41
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: Pre-build | |
on: | |
push: | |
branches: [master, pre-build] | |
pull_request: | |
branches: [master] | |
jobs: | |
arm-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pguyot/arm-runner-action@v2 | |
with: | |
image_additional_mb: 1024 | |
copy_artifact_path: builddir.tar.gz | |
commands: | | |
apt update -y | |
apt upgrade -y | |
apt install -y libgtk-3-dev python3 | |
apt install -y meson ninja | |
meson setup builddir --buildtype=release --default-library=shared | |
ninja -C builddir --verbose | |
tar -zcvf builddir.tar.gz builddir | |
- name: Extract compressed builddir | |
run: | | |
tar -zxvf builddir.tar.gz | |
ls -l | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Raspbian-aarch64-shared-release | |
path: | | |
!builddir/meson-out/*.p/ | |
builddir/meson-out/* | |
ui_unix.h | |
ui.h | |
builddir/meson-logs/*.txt | |
meson-linux: | |
strategy: | |
fail-fast: false | |
matrix: | |
# ubuntu-18.04, ubuntu-latest (ubuntu-20.04) | |
os: [ubuntu-latest] | |
# x86, x64 | |
arch: [x64] | |
libtype: [shared] | |
# debug, debugoptimized, release | |
buildtype: [release] | |
runs-on: ${{ matrix.os }} | |
name: Ubuntu-${{ matrix.arch }}-${{ matrix.libtype }} | |
steps: | |
- name: Install Meson and Linux Deps | |
run: | | |
python3 -m pip install --upgrade pip setuptools wheel | |
pip3 install meson ninja | |
sudo apt-get update -y | |
sudo apt-get install -y libgtk-3-dev xvfb | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Meson Setup Build | |
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }} | |
- name: Ninja Build | |
run: ninja -C builddir --verbose | |
- name: Run Tests | |
run: xvfb-run meson test -C builddir --verbose | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Ubuntu-${{ matrix.arch }}-${{ matrix.libtype }}-${{ matrix.buildtype }} | |
# lib + header + examples + test + build-log | |
path: | | |
!builddir/meson-out/*.p/ | |
builddir/meson-out/* | |
ui_unix.h | |
ui.h | |
builddir/meson-logs/*.txt | |
meson-windows: | |
strategy: | |
fail-fast: false | |
matrix: | |
# windows-latest, windows-2022 | |
os: [windows-latest] | |
arch: [x86, x64] | |
libtype: [shared] | |
# debug, debugoptimized, release | |
buildtype: [release] | |
runs-on: ${{ matrix.os }} | |
name: Win-${{ matrix.arch }}-${{ matrix.libtype }} | |
steps: | |
# Setup build env | |
- uses: actions/checkout@v3 | |
- name: Install Meson+Ninja | |
run: | | |
python -m pip install --upgrade pip | |
pip install meson ninja | |
- name: Setup MSVC | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- name: Meson Setup Build | |
shell: cmd | |
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }} | |
- name: Ninja Build | |
run: ninja -C builddir --verbose | |
- name: Run Tests | |
run: meson test -C builddir --verbose | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Win-${{ matrix.arch }}-${{ matrix.libtype }}-${{ matrix.buildtype }} | |
# lib + header + examples + test + build-log | |
path: | | |
!builddir/meson-out/*.p/ | |
builddir/meson-out/libui.* | |
ui_windows.h | |
ui.h | |
builddir/meson-out/*.exe | |
builddir/meson-out/*.pdb | |
builddir/meson-logs/*.txt | |
meson-windows-mingw: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest] | |
arch: [x64] | |
# only support static | |
libtype: [static] | |
# debug, debugoptimized, release | |
buildtype: [release] | |
runs-on: ${{ matrix.os }} | |
name: Mingw-${{ matrix.arch }}-${{ matrix.libtype }} | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
# Setup build env | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
base-devel | |
git | |
pacboy: >- | |
toolchain:x | |
meson:x | |
- uses: actions/checkout@v3 | |
- name: Meson Setup Build | |
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=static | |
- name: Ninja Build | |
run: ninja -C builddir --verbose | |
- name: Run Tests | |
run: meson test -C builddir --verbose | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Mingw-${{ matrix.arch }}-static-${{ matrix.buildtype }} | |
# lib + header + examples + test + build-log | |
path: | | |
builddir/meson-out/libui.a | |
ui_windows.h | |
ui.h | |
builddir/meson-out/*.exe | |
builddir/meson-logs/*.txt | |
meson-macos: | |
strategy: | |
fail-fast: false | |
matrix: | |
# macos-latest (macos-10.15), macos-11 | |
os: [macos-11] | |
libtype: [shared] | |
# debug, debugoptimized, release | |
buildtype: [release] | |
runs-on: ${{ matrix.os }} | |
name: macOS-x64-${{ matrix.libtype }} | |
steps: | |
- name: Install Meson and macOS Deps | |
run: | | |
# brew update # FIXME | |
brew install meson ninja | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Meson Setup Build | |
run: meson setup builddir --buildtype=${{ matrix.buildtype }} --default-library=${{ matrix.libtype }} | |
- name: Ninja Build | |
run: ninja -C builddir --verbose | |
- name: Run Tests | |
run: meson test -C builddir --verbose | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: macOS-x64-${{ matrix.libtype }}-${{ matrix.buildtype }} | |
# lib + header + examples + test + build-log | |
path: | | |
!builddir/meson-out/*.p/ | |
builddir/meson-out/* | |
ui_darwin.h | |
ui.h | |
builddir/meson-logs/*.txt |