mirror of
https://github.com/HerculesWS/Hercules
synced 2026-08-15 12:23:13 -04:00
97 lines
3.4 KiB
YAML
97 lines
3.4 KiB
YAML
name: gcc_test
|
|
|
|
on: workflow_call
|
|
|
|
env:
|
|
MYSQL_DATABASE: 'ragnarok'
|
|
MYSQL_USER: 'ragnarok'
|
|
MYSQL_PASSWORD: 'ragnarok'
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
DEBIAN_COMMON_PACKAGES: make zlib1g-dev libpcre3-dev git python3 libzstd-dev
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
CC: [gcc]
|
|
RENEWAL: ["", "--disable-renewal"]
|
|
CLIENT_TYPE: ["", "--enable-packetver-re", "--enable-packetver-zero"]
|
|
HTTPLIB: ["", "--with-http_parser=llhttp"]
|
|
SANITIZER: ["--disable-manager", "--disable-manager --enable-sanitize=full"]
|
|
PACKET_VERSION: ["--enable-packetver=20221024", "--enable-packetver=20130724"]
|
|
include:
|
|
# Empty CLASSIC_AUTOSPELL_LIST for every other flow
|
|
- CLASSIC_AUTOSPELL_LIST: ""
|
|
# Use "-DCLASSIC_AUTOSPELL_LIST" for 20130724 RE or we will get warnings due to the list being too small
|
|
- PACKET_VERSION: "--enable-packetver=20130724"
|
|
RENEWAL: ""
|
|
CLASSIC_AUTOSPELL_LIST: "-DCLASSIC_AUTOSPELL_LIST"
|
|
exclude:
|
|
- PACKET_VERSION: "--enable-packetver=20130724"
|
|
CLIENT_TYPE: "--enable-packetver-zero"
|
|
|
|
# github.head_ref will stop previous runs in the same PR (if in a PR)
|
|
# github.run_id is a fallback when outside a PR (e.g. every merge in master will run, and previous won't stop)
|
|
concurrency:
|
|
group: gcc_test-${{ github.head_ref || github.run_id }}_${{ matrix.CC }}_${{ matrix.RENEWAL }}_${{ matrix.CLIENT_TYPE }}_${{ matrix.HTTPLIB }}_${{ matrix.SANITIZER }}_${{ matrix.PACKET_VERSION}}
|
|
cancel-in-progress: true
|
|
|
|
container:
|
|
image: debian:unstable
|
|
services:
|
|
mariadb:
|
|
image: mariadb:latest
|
|
ports:
|
|
- 33306:3306
|
|
env:
|
|
MYSQL_DATABASE: 'ragnarok'
|
|
MYSQL_USER: 'ragnarok'
|
|
MYSQL_PASSWORD: 'ragnarok'
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
|
|
options: >-
|
|
--health-cmd="healthcheck.sh --connect --innodb_initialized"
|
|
--health-interval=5s
|
|
--health-timeout=2s
|
|
--health-retries=3
|
|
env:
|
|
INSTALL_PACKAGES: ${{ matrix.CC }} mariadb-client libmariadbclient-dev-compat
|
|
SQLHOST: mariadb
|
|
CC: ${{ matrix.CC }}
|
|
CONFIGURE_FLAGS: CC=${{ matrix.CC }} --enable-debug --enable-Werror --enable-buildbot ${{ matrix.RENEWAL }} ${{ matrix.HTTPLIB }} ${{ matrix.CLIENT_TYPE }} ${{ matrix.SANITIZER }} ${{ matrix.PACKET_VERSION }} --enable-lto CPPFLAGS=${{ matrix.CLASSIC_AUTOSPELL_LIST }}
|
|
PACKET_VERSION: ${{ matrix.PACKET_VERSION }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: info
|
|
run: |
|
|
uname -a
|
|
|
|
- name: install packages
|
|
run: |
|
|
./tools/ci/retry.sh apt-get update
|
|
./tools/ci/retry.sh apt-get install -y -qq $INSTALL_PACKAGES $DEBIAN_COMMON_PACKAGES
|
|
|
|
- name: init database
|
|
run: |
|
|
./tools/ci/travis.sh importdb ragnarok ragnarok ragnarok $SQLHOST
|
|
|
|
- name: get plugins
|
|
run: |
|
|
./tools/ci/travis.sh getplugins || true
|
|
|
|
- name: build
|
|
run: |
|
|
./tools/ci/travis.sh build $CONFIGURE_FLAGS
|
|
|
|
- name: test
|
|
run: |
|
|
./tools/ci/travis.sh test ragnarok ragnarok ragnarok $SQLHOST
|
|
|
|
- name: extra test
|
|
if: env.PACKET_VERSION != '--enable-packetver=20130724'
|
|
run: |
|
|
./tools/ci/travis.sh extratest
|