1. Adds a `libdevilution_so` target when tests are enabled. 2. Each test file is now a separate binary target linked against `libdevilutionx_so` (can now run tests in parallel). 3. Tests are now defined in a separate `test/CMakeLists.txt` file. 4. Building the tests is now controlled by the standard `BUILD_TESTING` option (defined by CTest). 5. Tests are now built by default. 6. On CI, test errors are now reported. Also: * `.clang-format`: Enable SortIncludes in tests * `path_test.cpp`: Fix -Wsign-compare
90 lines
3.9 KiB
YAML
90 lines
3.9 KiB
YAML
version: 2
|
|
jobs:
|
|
linux_x86_64:
|
|
docker:
|
|
- image: debian:stretch-backports
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: echo deb http://deb.debian.org/debian stretch-backports-sloppy main >> /etc/apt/sources.list.d/debian-backports.list
|
|
- run: apt update -y
|
|
- run: apt install -y g++ libsdl2-dev libbz2-dev git rpm wget smpq
|
|
- run: apt install -y -t 'stretch-backports*' cmake libsodium-dev libpng-dev
|
|
- run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TESTING=OFF -DCPACK=ON -DCMAKE_INSTALL_PREFIX=/usr
|
|
- run: cmake --build build -j 2 --target package
|
|
- store_artifacts: {path: ./build/devilutionx, destination: devilutionx_linux_x86_64}
|
|
- run: Packaging/nix/LinuxReleasePackaging.sh
|
|
- run: Packaging/nix/AppImage.sh
|
|
- store_artifacts: {path: ./devilutionx.appimage, destination: devilutionx_linux_x86_64.appimage}
|
|
- store_artifacts: {path: ./devilutionx.tar.xz, destination: devilutionx_linux_x86_64.tar.xz}
|
|
linux_x86_64_test:
|
|
docker:
|
|
- image: debian:testing
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: apt-get update -y
|
|
- run: apt-get install -y cmake curl g++ git lcov libgtest-dev libgmock-dev libfmt-dev libsdl2-dev libsodium-dev libpng-dev libbz2-dev
|
|
- run: cmake -S. -Bbuild -DENABLE_CODECOVERAGE=ON
|
|
- run: cmake --build build -j 2
|
|
- run: cd build && ctest --output-on-failure
|
|
- run: bash <(curl -s https://codecov.io/bash)
|
|
environment:
|
|
CTEST_OUTPUT_ON_FAILURE: 1
|
|
switch:
|
|
docker:
|
|
- image: devkitpro/devkita64:latest
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
- run: cmake --build build -j 2
|
|
- store_artifacts: {path: ./build/devilutionx.nro, destination: devilutionx.nro}
|
|
3ds:
|
|
docker:
|
|
- image: devkitpro/devkitarm:latest
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: apt-get update -y
|
|
- run: apt-get install -y ffmpeg gettext smpq
|
|
- run: wget https://github.com/Steveice10/bannertool/releases/download/1.2.0/bannertool.zip
|
|
- run: unzip -j "bannertool.zip" "linux-x86_64/bannertool" -d "/opt/devkitpro/tools/bin"
|
|
- run: wget https://github.com/jakcron/Project_CTR/releases/download/v0.16/makerom_016_ctrtool.zip
|
|
- run: unzip -j "makerom_016_ctrtool.zip" "Ubuntu/makerom" -d "/opt/devkitpro/tools/bin"
|
|
- run: sudo chmod +rx /opt/devkitpro/tools/bin/makerom
|
|
- run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/3DS.cmake
|
|
- run: cmake --build build -j 2
|
|
- store_artifacts: {path: ./build/devilutionx.3dsx, destination: devilutionx.3dsx}
|
|
- store_artifacts: {path: ./build/devilutionx.cia, destination: devilutionx.cia}
|
|
amigaos-m68k:
|
|
docker:
|
|
- image: amigadev/crosstools:m68k-amigaos
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: Packaging/amiga/prep.sh
|
|
- run: PKG_CONFIG_PATH=/opt/m68k-amigaos/lib/pkgconfig/:/opt/m68k-amigaos/share/pkgconfig/ cmake -S. -Bbuild -DM68K_CPU=68040 -DM68K_FPU=hard -DM68K_COMMON="-s -ffast-math -O3 -noixemul -D__BIG_ENDIAN__ -D__AMIGA__ -fpermissive" ..
|
|
- run: cd build && make -j2
|
|
- store_artifacts: {path: ./build/devilutionx, destination: devilutionx_m68k}
|
|
vita:
|
|
docker:
|
|
- image: vitasdk/vitasdk:latest
|
|
working_directory: ~/repo
|
|
steps:
|
|
- checkout
|
|
- run: apk --no-cache add git cmake ninja bash pkgconfig gettext
|
|
- run: cmake -S. -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
- run: cmake --build build -j 2
|
|
- store_artifacts: {path: ./build/devilutionx.vpk, destination: devilutionx.vpk}
|
|
|
|
workflows:
|
|
version: 2
|
|
testflow:
|
|
jobs:
|
|
- linux_x86_64
|
|
- linux_x86_64_test
|
|
- switch
|
|
- 3ds
|
|
- amigaos-m68k
|
|
- vita
|