2021-03-05 21:44:21 +00:00
|
|
|
name: build
|
2021-03-18 13:02:09 +00:00
|
|
|
on: [push, pull_request]
|
2021-03-05 21:44:21 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, macos-latest, ubuntu-latest]
|
2022-06-23 19:24:17 +00:00
|
|
|
build_type: [RelWithDebInfo, Debug]
|
2021-03-05 21:44:21 +00:00
|
|
|
enable_ui: [off]
|
|
|
|
include:
|
|
|
|
- os: ubuntu-latest
|
2022-06-23 19:24:17 +00:00
|
|
|
build_type: Debug
|
2021-03-05 21:44:21 +00:00
|
|
|
enable_ui: on
|
|
|
|
steps:
|
2023-08-02 21:46:52 +00:00
|
|
|
- uses: actions/checkout@v3
|
2021-03-05 21:44:21 +00:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2021-04-15 09:54:53 +00:00
|
|
|
- name: ccache
|
|
|
|
uses: hendrikmuhs/ccache-action@v1
|
|
|
|
if: runner.os == 'Linux'
|
|
|
|
with:
|
2023-04-11 07:50:00 +00:00
|
|
|
key: ${{ matrix.os }}-${{ matrix.enable_ui }}-${{ matrix.build_type }}
|
2023-08-02 21:46:52 +00:00
|
|
|
- uses: turtlesec-no/get-ninja@main
|
2021-03-05 21:44:21 +00:00
|
|
|
- uses: ilammy/msvc-dev-cmd@v1
|
|
|
|
if: runner.os == 'Windows'
|
2022-12-02 14:29:59 +00:00
|
|
|
- name: Workaround for windows-2022 and cmake 3.25.0
|
|
|
|
if: runner.os == 'Windows'
|
|
|
|
shell: bash
|
|
|
|
run: rm -rf C:/Strawberry/
|
2021-03-05 21:44:21 +00:00
|
|
|
- name: Install Dependencies
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ "${{ runner.os }}" == "Linux" ]] ; then
|
|
|
|
sudo apt-get update -qq
|
|
|
|
sudo apt-get install -y \
|
|
|
|
libx11-dev libxcursor-dev libxi-dev
|
|
|
|
fi
|
|
|
|
- name: Generating Makefiles
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-06-28 17:33:12 +00:00
|
|
|
if [[ "${{ runner.os }}" == "Windows" ]] ; then
|
|
|
|
export enable_ccache=off
|
|
|
|
else
|
|
|
|
export enable_ccache=on
|
|
|
|
fi
|
2021-03-05 21:44:21 +00:00
|
|
|
cmake -S . -B build -G Ninja \
|
2022-06-23 19:24:17 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
2022-06-09 22:10:31 +00:00
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
|
2021-03-05 21:44:21 +00:00
|
|
|
-DENABLE_TESTS=ON \
|
2022-06-28 17:33:12 +00:00
|
|
|
-DENABLE_UI=${{ matrix.enable_ui }} \
|
|
|
|
-DENABLE_CCACHE=$enable_ccache
|
2021-03-05 21:44:21 +00:00
|
|
|
- name: Compiling
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
cd build && ninja
|
|
|
|
- name: Running C++ Tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ "${{ runner.os }}" == "Linux" ]] ; then
|
|
|
|
export XVFB=xvfb-run
|
|
|
|
fi
|
|
|
|
cd build && $XVFB ctest --output-on-failure
|
|
|
|
- name: Running CLI Tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
if [[ "${{ runner.os }}" == "Linux" ]] ; then
|
|
|
|
export XVFB=xvfb-run
|
|
|
|
fi
|
2022-10-25 18:24:58 +00:00
|
|
|
export ASEPRITE=$PWD/build/bin/aseprite
|
2021-03-05 21:44:21 +00:00
|
|
|
cd tests
|
|
|
|
$XVFB bash run-tests.sh
|