mirror of
https://github.com/rt64/rt64.git
synced 2024-12-28 18:31:51 +00:00
71 lines
2.4 KiB
YAML
71 lines
2.4 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
|
|
- 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=Debug -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 Debug --target rt64 -j 8
|
|
- name: Build RT64 (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |-
|
|
# enable ccache
|
|
set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
|
|
|
|
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 Debug --target rt64 -j 8
|