Skip to content

Move to diligent

Move to diligent #733

Workflow file for this run

name: CI/CD - BUILD
on:
pull_request:
workflow_dispatch:
push:
branches: master
permissions:
contents: write
actions: write
checks: write
pull-requests: write
discussions: write
issues: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-linux:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y build-essential wget cmake libssl-dev libvpx-dev gcc-11 libgl1-mesa-glx libgl1-mesa-dev libglew-dev ninja-build python3-pip libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev
- name: Cache c++
uses: hendrikmuhs/ccache-action@v1.2.10
with:
append-timestamp: false
restore-keys: host-${{ runner.os }}-${{ hashFiles('./CMakeLists.txt', './bass/CMakeLists.txt', './engine/CMakeLists.txt', './math/CMakeLists.txt', './render/CMakeLists.txt', './resources/CMakeLists.txt', './ui/CMakeLists.txt', './utils/CMakeLists.txt', './physics_3d/CMakeLists.txt', './physics_2d/CMakeLists.txt', './webm/CMakeLists.txt', './assimp/CMakeLists.txt', './scripting/CMakeLists.txt', './network/CMakeLists.txt') }}-
key: host-${{ runner.os }}-${{ hashFiles('./CMakeLists.txt', './bass/CMakeLists.txt', './engine/CMakeLists.txt', './math/CMakeLists.txt', './render/CMakeLists.txt', './resources/CMakeLists.txt', './ui/CMakeLists.txt', './utils/CMakeLists.txt', './physics_3d/CMakeLists.txt', './physics_2d/CMakeLists.txt', './webm/CMakeLists.txt', './assimp/CMakeLists.txt', './scripting/CMakeLists.txt', './network/CMakeLists.txt') }}
- name: CMAKE Setup
id: setup
run: |
mkdir -p build && cd build
CXX=g++ cmake .. -G Ninja -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_RUNTIME_OUTPUT_DIRECTORY="bin" -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DRAWRBOX_DEV_MODE:BOOL="ON"
cd ../
- name: Build
id: build
run: cd build && ninja
- name: Run tests
run: |
cd build
ctest --test-dir ./math --output-on-failure
ctest --test-dir ./utils --output-on-failure
ctest --test-dir ./render --output-on-failure
ctest --test-dir ./engine --output-on-failure
ctest --test-dir ./resources --output-on-failure
# ctest --test-dir ./scripting --output-on-failure
- name: Run linter
uses: cpp-linter/cpp-linter-action@v2.6.0
if: github.ref != 'refs/heads/master'
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
files-changed-only: true
tidy-checks: ""
extra-args: "-std=c++20 -Wall"
version: "16"
database: "./build/"
thread-comments: true
ignore: build | _deps | .github | render/include/stb | engine/tests | math/tests | render/tests | resources/tests | utils/tests | scripting/tests
- name: Upload build artifacts
if: github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v3
with:
name: output
path: bin