mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-06 12:53:13 +02:00
92 lines
2.8 KiB
YAML
92 lines
2.8 KiB
YAML
name: Linux CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["unreal60_dev"]
|
|
pull_request:
|
|
branches: ["unreal60_dev"]
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
|
|
env:
|
|
NOSERVICES: 1
|
|
RUNTESTFLAGS: "-slightlyfast"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
compiler:
|
|
- { c: gcc, cpp: g++ }
|
|
- { c: clang, cpp: clang++ }
|
|
|
|
env:
|
|
CC: ${{ matrix.compiler.c }}
|
|
CXX: ${{ matrix.compiler.cpp }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
#uses: actions/checkout@v4
|
|
#no, pin to v4.2.2 for security reasons:
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
#and we don't need the credentials later..
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 1
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo rm -f /var/lib/man-db/auto-update
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends \
|
|
build-essential pkg-config libssl-dev libpcre2-dev libargon2-dev \
|
|
libsodium-dev libc-ares-dev libcurl4-openssl-dev libjansson-dev
|
|
|
|
- name: Install python dependencies
|
|
run: |
|
|
python -m pip install --break-system-packages pyasyncore pyasynchat
|
|
|
|
- name: Build
|
|
run: extras/build-tests/nix/build
|
|
|
|
- name: Run tests
|
|
run: extras/build-tests/nix/run-tests
|
|
|
|
format-check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
|
- name: Checkout
|
|
#uses: actions/checkout@v4
|
|
#no, pin to v4.2.2 for security reasons:
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
#and we don't need the credentials later..
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 1
|
|
|
|
# We pin clang-format to major version 21 because different versions
|
|
# format slightly differently (which would cause false failures).
|
|
# This must match the version developers use, see also the comment
|
|
# at the top of the .clang-format file.
|
|
- name: Install clang-format 21
|
|
run: |
|
|
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt-llvm-org.asc >/dev/null
|
|
echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" | sudo tee /etc/apt/sources.list.d/llvm21.list
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends clang-format-21
|
|
|
|
# Same check as 'make format-check' in Makefile.in (we cannot use
|
|
# that directly here because 'make' requires ./configure to have run).
|
|
- name: Check code formatting
|
|
run: |
|
|
clang-format-21 --version
|
|
clang-format-21 --dry-run --Werror `git ls-files src include | grep -E '\.(c|h)$' | grep -vE 'crypt_blowfish|openssl_hostname_validation'`
|