Skip to content

Commit

Permalink
Added pre-build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Nov 8, 2023
1 parent 2746470 commit ee87a87
Showing 1 changed file with 202 additions and 0 deletions.
202 changes: 202 additions & 0 deletions .github/workflows/pre-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
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-pip tree
python3 -m pip install --upgrade pip setuptools wheel
pip3 install 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

0 comments on commit ee87a87

Please sign in to comment.