mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-19 14:00:55 +02:00
* po co chodzic, mozna latac * Fix jni ownership, split helpers --------- Co-authored-by: Mia <uwie@thinkwise.ro> Co-authored-by: komaruworld <rtysus228@gmail.com>
129 lines
3.6 KiB
YAML
129 lines
3.6 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- '.github/workflows/**'
|
|
- 'CMakeLists.txt'
|
|
- 'Makefile'
|
|
- 'README.md'
|
|
- '.gitmodules'
|
|
- 'cmake/**'
|
|
- 'config/**'
|
|
- 'include/**'
|
|
- 'packaging/**'
|
|
- 'scripts/**'
|
|
- 'src/**'
|
|
- 'stubs/**'
|
|
- 'tests/**'
|
|
- 'third_party/**'
|
|
pull_request:
|
|
paths:
|
|
- '.github/workflows/**'
|
|
- 'CMakeLists.txt'
|
|
- 'Makefile'
|
|
- 'README.md'
|
|
- '.gitmodules'
|
|
- 'cmake/**'
|
|
- 'config/**'
|
|
- 'include/**'
|
|
- 'packaging/**'
|
|
- 'scripts/**'
|
|
- 'src/**'
|
|
- 'stubs/**'
|
|
- 'tests/**'
|
|
- 'third_party/**'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
contracts:
|
|
name: Repository contracts
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Validate shell and JSON files
|
|
shell: bash
|
|
run: |
|
|
find scripts tests -type f -name '*.sh' -print0 | xargs -0 -n1 bash -n
|
|
find config packaging/flatpak -type f -name '*.json' -print0 \
|
|
| xargs -0 -n1 python3 -m json.tool >/dev/null
|
|
|
|
- name: Run script unit tests
|
|
shell: bash
|
|
run: |
|
|
python3 -m pip install --disable-pip-version-check requests
|
|
python3 -m unittest discover -s tests -p '*_test.py' -v
|
|
|
|
- name: Verify build and packaging contracts
|
|
shell: bash
|
|
run: |
|
|
bash tests/managed_payload_build_contract_test.sh .
|
|
bash tests/flatpak_packaging_test.sh .
|
|
bash tests/native_packaging_test.sh .
|
|
bash tests/anylinux_dependencies_test.sh .
|
|
|
|
native-build:
|
|
name: Native build (${{ matrix.arch }})
|
|
runs-on: ${{ matrix.runner }}
|
|
timeout-minutes: 60
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: x86_64
|
|
runner: ubuntu-26.04
|
|
- arch: aarch64
|
|
runner: ubuntu-26.04-arm
|
|
steps:
|
|
- name: Check out source
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install build dependencies
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install --yes --no-install-recommends \
|
|
build-essential binutils cmake git ninja-build pkg-config lld \
|
|
libsdl3-dev libsdl3-ttf-dev libcurl4-openssl-dev libssl-dev \
|
|
nlohmann-json3-dev libyaml-dev libelf-dev libminizip-dev \
|
|
libcapstone-dev libgtk-4-dev libadwaita-1-dev libwebkitgtk-6.0-dev \
|
|
libutf8proc-dev libfontconfig1-dev libegl-dev libvulkan-dev \
|
|
libplacebo-dev libpng-dev zlib1g-dev \
|
|
xvfb xauth libgl1-mesa-dri jq patchelf
|
|
|
|
- name: Build and check native executables
|
|
shell: bash
|
|
run: |
|
|
test "$(uname -m)" = "${{ matrix.arch }}"
|
|
cmake -S . -B build-ci -G Ninja \
|
|
-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
|
|
cmake --build build-ci --parallel 4
|
|
./build-ci/mocktail --help
|
|
./build-ci/mocktail_updater status
|
|
|
|
- name: Run C++ and integration tests
|
|
shell: bash
|
|
env:
|
|
SDL_AUDIODRIVER: dummy
|
|
SDL_VIDEODRIVER: x11
|
|
LIBGL_ALWAYS_SOFTWARE: '1'
|
|
run: |
|
|
xvfb-run -a ctest --test-dir build-ci --output-on-failure \
|
|
--parallel 4 --timeout 120
|