mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-28 04:47:32 +01:00
origin/staging7ac2472c3into feat/gl46-migrationdb26a33ed, so that #468 merges into staging. Merge base037158104. Staging carries master up to571487612(squashed in #514); this branch had merged master up to7c12b83ba. Conflicts, file by file: - README.md: WITH_BETTER_RENDERER row dropped (gl46), USE_SYSTEM_JSON row kept (staging) - CMakeLists.txt: gl46 lists, plus staging's new core sources (hardwareinfo, sn_utils, regionfile, inionlysettings, fieldshunting, gaugewrap, drivingaid, signalpassing, brakereleaser, crew, brakecharge); none listed twice - tests/unit/CMakeLists.txt: both (texturealpha, freecameramotion; editorSwitchDrives, Camera) - vehicle/brakingcurve.{h,cpp}, tests/unit/test_braking_curve.cpp (add/add): staging (#479 brake_acting on the same #409 code) - editor/editorHttp.cpp: staging (it has gl46's #432 and certificate fixes, plus #439 libcurl loaded at run time) - tests/unit/test_editor_http.cpp (add/add): staging (adds the available() case of #439) - utilities/Globals.h: gl46 crashdump_full (staging's CrashDumpFull is #425, replaced here by utilities/crashdump.cpp); fmradio and staging's OpenAL options both; gfx_headlights_beamwidth (#481) not taken - utilities/Globals.cpp: both (odometer.expiry, OpenAL keys, fmradio, gl46 gfx keys); gfx.headlights.beamwidth (#481) not taken - utilities/Logs.cpp: staging's log_file_name() for both files, with gl46's crashdump_set_log_file() for both - utilities/utilities.h: gl46 set_thread_random_engine(); Random(int, int) gone on both sides - tests/unit/test_utilities.cpp: staging's includes - simulation/simulationtest.cpp: gl46 (no NvRenderer, LegacyRenderer, BasicRenderer here) - ci_shadervalidator/* (incl. add/add utilities/Logs.h): gl46's validator of shaders/ogl46 and shaders/vk14; staging's #437 fixed the GL 3.3 one - gl/shader.cpp, gl/glsl_common.cpp: gl46 (shaders come from rendering/common/shadersource.cpp); HEADLIGHT_BEAM_WIDTH (#481) not taken - shaders/mat_wire.frag: gl46. Rename detection paired staging's mat_colored.frag (#481) with it - lang/editor_pl.po: union; the 12 camera speed / orthophoto entries staging adds are here already (master #312) - audio/audiorenderer.{h,cpp}: both (fmradio; startsample and the low-pass filter); the destructor releases the radio, then the filter - application/editormode.h, application/editormodeswitchdrive.cpp: staging (#509 on #330, which is all this side had) - application/application.cpp: gl46's start sequence (no init_ogl, ANGLE or NvRenderer; crash window after init_ui) with staging's hardware::log_system() (#389) - EU07.cpp: gl46 (crash reports of utilities/crashdump.cpp); staging's side was #425's handler, replaced here - model/Texture.{h,cpp}: gl46 (texture_source); staging's side is master #399/#411/#362/#386, merged here before - world/Track.h, world/TrackSleepers.h: both (TrackBlend, lay(Fastened)/fasten; TrackBuckle, pack_models) - world/Segment.cpp: staging's track buckling on the split stray factors both sides have - vehicle/Driver.h: staging's additions (#444, #494, #473, #346, timetable flags) - vehicle/Driver.cpp: staging's file, with this branch'sf4f8c75e4(road orders measured along the lane) and8fbf05674(a holding road order blocks the ones past it) applied again; #409's SeenAheadTolerance gives way to #473 - vehicle/DynObj.h: friend opengl46_renderer and friend class vehicle_table - vehicle/DynObj.cpp: gl46's vehicle_table::update() with staging's update_off_track_contacts() and update_brake_pipes() - McZapkie/Mover.cpp: staging's function splits (#239) and hose exchange (#388); every line this branch added to Mover.cpp/MOVER.h is kept - .github/workflows/build_bin.yml: staging's apt-install step (#497) and pinned download-artifact (#331) Modify/delete, kept deleted: - rendering/opengl33renderer.{cpp,h}, rendering/openglparticles.cpp, rendering/openglrenderer.{cpp,h}: staging's versions are master's, and every master change to them is in this branch's history already - shaders/light_common.glsl, shaders/mat_sunlessnormalmap_specgloss.frag: see below Carried into this branch's code: - the hose exchange after each sub-step (#387/#388) also in update_steps_parallel(), per group of vehicles, as update() does it single-threaded - physics.pipewake (pipe_wakes(), wake_cause::scndpipe) in staging's GetScndDVc(), where the main reservoir hose exchange went - hardware::log_gl_context() (#389) in after_window() of the GL 4.6 backend, init_ogl() being gone Taken back out of the auto-merge (renderers this branch removed): - shaders/vk14/tonemapping.glsl: #481's switch to ACES, applied there by rename detection - environment/skydome.cpp, simulation/simulationenvironment.cpp: #415, the sky of the legacy renderer - application/application.cpp: #384's fallback of an unknown gfxrenderer, which this branch had dropped Not carried from staging (renderer files removed here): - master #481 (571487612): old assets drawn as in 26.05 (metal diffuse, sun highlight tint, ACES, SUN_DIFFUSE_SCALE 2.5, untinted Diffuse, mat_colored base) and gfx.headlights.beamwidth. Made for the GL 3.3 shaders; the PBR shaders of shaders/ogl46 and vk14 (and their SPIR-V binaries) are the author's call - #437: the unique temporary file of the shader validator (Sonar S5443); gl46's validator still writes /tmp/shader* Unit tests: 1133 of 1137 cases pass. Four staging tests fail (derailment: a repaired vehicle is back on the rails; three pullee cases): the vehicle stands, and with physics.sleepheld (on by default here) its physics sleeps with the Fb / FStand of before. With physics.sleepheld off they pass. Left to the author.
128 lines
5.1 KiB
YAML
128 lines
5.1 KiB
YAML
# .github/workflows/build.yml
|
|
# UNTRUSTED CONTEXT. This workflow runs fork-authored code.
|
|
# It must never reference `secrets.*` (other than the default GITHUB_TOKEN,
|
|
# which is read-only here). Do not add SONAR_TOKEN to this file.
|
|
|
|
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
types: [ opened, reopened, synchronize ]
|
|
|
|
permissions: {}
|
|
|
|
# A newer push to a pull request makes the run for its older commit pointless, so that run is
|
|
# cancelled (sonar.yml then marks the analysis of the older commit as skipped). A push to master
|
|
# gets a group of its own, its commit, so the runs on master are neither cancelled nor held back
|
|
# by one another.
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build under Build Wrapper
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
BUILD_WRAPPER_OUT_DIR: bw-output
|
|
steps:
|
|
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
|
with:
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Set up Python 3.14
|
|
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
with:
|
|
python-version: '3.14'
|
|
|
|
# The packages are kept in the Actions cache (.github/actions/apt-install): the mirror of the
|
|
# runners has been too slow to download them every time. The timeout is a safety net.
|
|
# The X11 packages are the ones GLFW (ref/glfw, 3.4) looks for; xorg-dev brought ~45 more.
|
|
- name: Install build dependencies
|
|
timeout-minutes: 15
|
|
uses: ./.github/actions/apt-install
|
|
with:
|
|
packages: >-
|
|
build-essential pkg-config
|
|
libgl1-mesa-dev libglew-dev libglfw3-dev
|
|
libpng-dev libopenal-dev libluajit-5.1-dev
|
|
libserialport-dev libsndfile1-dev
|
|
libx11-dev libxcursor-dev libxext-dev libxi-dev libxinerama-dev libxrandr-dev
|
|
libxkbcommon-dev libwayland-dev wayland-protocols
|
|
|
|
- name: Build current OpenAL Soft
|
|
run: |
|
|
git clone --depth 1 --branch 1.24.2 https://github.com/kcat/openal-soft.git /tmp/openal-soft
|
|
cmake -S /tmp/openal-soft -B /tmp/openal-soft/build \
|
|
-DCMAKE_BUILD_TYPE=Release -DALSOFT_EXAMPLES=OFF -DALSOFT_UTILS=OFF
|
|
cmake --build /tmp/openal-soft/build -j"$(nproc)"
|
|
sudo cmake --install /tmp/openal-soft/build
|
|
sudo ldconfig
|
|
|
|
# A little bit of magic for unbreaking GCC. Not an issue for Clang and MSVC.
|
|
# Fix for specific hard-errors for a combo of: varargs and always_inline
|
|
- name: Patch GLM for GCC
|
|
run: |
|
|
sed -i 's/GLM_FUNC_QUALIFIER std::string format(const char\* message, \.\.\.)/inline std::string format(const char* message, ...)/' \
|
|
ref/glm/glm/gtx/string_cast.inl
|
|
grep -n "std::string format(const char\* message" ref/glm/glm/gtx/string_cast.inl
|
|
|
|
- name: Install SonarQube Cloud Build Wrapper
|
|
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@fd88b7d7ccbaefd23d8f36f73b59db7a3d246602 # v6.0.0
|
|
|
|
- name: Configure (CMake)
|
|
run: |
|
|
cmake -S . -B build \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DWITH_ZMQ=OFF -DWITH_OPENVR=OFF -DUSE_LTO=OFF \
|
|
-DCMAKE_CXX_FLAGS="-Wno-attributes -fno-inline-functions-called-once" \
|
|
-DPython3_EXECUTABLE="$(which python3)"
|
|
|
|
- name: Build under Build Wrapper
|
|
run: |
|
|
build-wrapper-linux-x86-64 \
|
|
--out-dir "${BUILD_WRAPPER_OUT_DIR}" \
|
|
cmake --build build --config Release -j"$(nproc)"
|
|
|
|
# Metadata the trusted workflow needs to identify the PR.
|
|
# Treated as UNVERIFIED input there and re-checked against the API.
|
|
- name: Record event metadata
|
|
env:
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
COMMIT_SHA: ${{ github.sha }}
|
|
run: |
|
|
mkdir -p .sonar-meta
|
|
printf '%s\n' "$EVENT_NAME" > .sonar-meta/event
|
|
printf '%s\n' "$PR_NUMBER" > .sonar-meta/pr_number
|
|
printf '%s\n' "$PR_HEAD_SHA" > .sonar-meta/head_sha
|
|
printf '%s\n' "$COMMIT_SHA" > .sonar-meta/sha
|
|
|
|
# The C/C++ analyzer needs the sources AND the build-wrapper output.
|
|
# compile_commands.json holds absolute paths, so the trusted workflow must
|
|
# unpack this at the same $GITHUB_WORKSPACE path — same repo, so it matches.
|
|
- name: Pack analysis input
|
|
run: |
|
|
tar -czf /tmp/workspace.tar.gz \
|
|
--exclude='./build/CMakeFiles' \
|
|
--exclude='*.o' \
|
|
--exclude='*.a' \
|
|
--exclude='*.so' \
|
|
--exclude='*.so.*' \
|
|
-C "$GITHUB_WORKSPACE" .
|
|
|
|
- name: Upload analysis input
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: sonar-input
|
|
path: /tmp/workspace.tar.gz
|
|
retention-days: 1
|
|
if-no-files-found: error
|