rt64/.github/workflows/validate.yml

75 lines
2.9 KiB
YAML
Raw Normal View History

2024-01-20 14:14:50 +00:00
name: validate
on:
push:
branches:
2024-05-16 02:37:35 +00:00
- main
2024-01-20 14:14:50 +00:00
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
2024-08-04 18:36:28 +00:00
uses: actions/checkout@v4
2024-01-20 14:14:50 +00:00
with:
2024-08-04 18:36:28 +00:00
submodules: recursive
2024-01-20 14:14:50 +00:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
2024-05-25 18:44:27 +00:00
key: ${{ runner.os }}-rt64-ccache-${{ matrix.type }}
2024-01-20 14:14:50 +00:00
- 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
Fix most warnings (#35) * 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
2024-06-20 21:57:24 +00:00
2024-01-20 14:14:50 +00:00
# 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"
Fix most warnings (#35) * 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
2024-06-20 21:57:24 +00:00
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
2024-05-25 18:44:27 +00:00
cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $(nproc)
2024-01-20 14:14:50 +00:00
- name: Build RT64 (Windows)
if: runner.os == 'Windows'
run: |-
# enable ccache
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
2024-05-25 18:44:27 +00:00
$cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
Fix most warnings (#35) * 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
2024-06-20 21:57:24 +00:00
# remove LLVM from PATH so it doesn't overshadow the one provided by VS
$env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
2024-05-25 18:44:27 +00:00
cmake --build cmake-build --config ${{ matrix.type }} --target rt64 -j $cpuCores