mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 11:03:25 -08:00
* pin used actions plus some reordering and harmonization across files * [CI] Link the version string and RNG stub into the test targets The distribution libgtest.a now used by the Linux images makes the linker pull more translation units out of libcockatrice_network than the fetched googletest did. Those units reference VERSION_STRING and the global rng, which several test targets never defined, so the instrumented Ubuntu 26.04 legs failed at link: undefined reference to `VERSION_STRING' undefined reference to `rng' Add the generated version string source wherever a test links the network umbrella, and define the rng stub in the tests that pull the server game classes without declaring it. This matches what the neighbouring server tests already do. A full Debug build and ctest suite in the ci-ubuntu2604 image (system libgtest.a) is green: 841 tests pass. Fixes the nightly failures introduced by #6894. --------- Co-authored-by: Lukas Brübach <44814898+BruebachL@users.noreply.github.com>
44 lines
1.1 KiB
YAML
44 lines
1.1 KiB
YAML
name: Code Style (C++)
|
|
|
|
permissions:
|
|
contents: read # needed to checkout repo
|
|
|
|
on:
|
|
# Push trigger not needed for linting, we do not allow direct pushes to master
|
|
pull_request:
|
|
paths:
|
|
- '*/**' # matches all files not in root
|
|
- '!**.md'
|
|
- '!.ci/**'
|
|
- '!.github/**'
|
|
- '!.tx/**'
|
|
- '!docs/**'
|
|
- '.ci/lint_cpp.sh'
|
|
- '.github/workflows/desktop-lint.yml'
|
|
- '.clang-format'
|
|
- '.cmake-format.json'
|
|
- 'format.sh'
|
|
|
|
jobs:
|
|
format:
|
|
name: "Check formatting"
|
|
runs-on: ubuntu-slim # https://github.com/actions/runner-images/blob/main/images/ubuntu-slim/ubuntu-slim-Readme.md
|
|
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 20 # should be enough to find merge base
|
|
|
|
- name: "Install dependencies"
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
clang-format \
|
|
cmake-format \
|
|
shellcheck
|
|
|
|
- name: "Check code formatting"
|
|
shell: bash
|
|
run: ./.ci/lint_cpp.sh
|