mirror of
https://github.com/rt64/rt64.git
synced 2024-12-27 15:23:07 +00:00
ed7511300c
* Turn on warnings * -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function * Fix -Wformat ``` warning: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Wformat] ``` * Fix -Wrange-loop-construct warning ``` warning: loop variable 'it' creates a copy from type 'std::pair<const std::basic_string<char>, RT64::PresetLights::Light> const' [-Wrange-loop-construct] ``` * -Wsign-compare ``` comparison of integers of different signs: 'int32_t' (aka 'int') and 'uint32_t' (aka 'unsigned int') ``` * -Wrange-loop-construct ``` warning: loop variable ‘it’ creates a copy from type ‘const std::pair<const std::__cxx11::basic_string<char>, RT64::PresetDrawCall>’ ``` * rerun * Fix -Wparentheses ``` warning: suggest parentheses around arithmetic in operand of ‘^’ ``` * -Wsign-compare ``` warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘unsigned int’ ``` * Update hlslpp to fix a number of warnings * Remove `#pragma once` in cpp file ``` warning: #pragma once in main file ``` * -Wswitch ``` warning: enumeration value ‘None’ not handled in switch ``` * -Wformat-security ``` warning: format not a string literal and no format arguments ``` * regen * Move warnings to clang check * Fix -Wdelete-non-abstract-non-virtual-dtor ``` warning: destructor called on non-final 'RT64::PresetMaterial' that has virtual functions but non-virtual destructor ``` * remove warnings file * Fix one unused parameter * Fix assert wrapping * Add -Werror flag * Change type of `dstIndex` to `uint32_t` * More uses I missed * Fix new warnings
72 lines
2.6 KiB
YAML
72 lines
2.6 KiB
YAML
name: validate
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
type: [ Debug, Release ]
|
|
os: [ ubuntu-latest, windows-latest]
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ runner.os }}-rt64-ccache-${{ matrix.type }}
|
|
- name: Install Windows Dependencies
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
choco install ninja
|
|
Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
|
|
- name: Install Linux Dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev
|
|
|
|
# Install SDL2
|
|
echo ::group::install SDL2
|
|
|
|
# Enable ccache
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz
|
|
tar -xzf SDL2-2.26.1.tar.gz
|
|
cd SDL2-2.26.1
|
|
./configure
|
|
make -j 10
|
|
sudo make install
|
|
sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
|
|
echo ::endgroup::
|
|
- name: Configure Developer Command Prompt
|
|
if: runner.os == 'Windows'
|
|
uses: ilammy/msvc-dev-cmd@v1
|
|
- name: Build RT64 (Unix)
|
|
if: runner.os != 'Windows'
|
|
run: |-
|
|
# enable ccache
|
|
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
|
cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $(nproc)
|
|
- name: Build RT64 (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |-
|
|
# enable ccache
|
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
|
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
|
|
|
|
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
|
|
cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $cpuCores
|