mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
59 lines
2.1 KiB
YAML
59 lines
2.1 KiB
YAML
name: Linux
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
Linux:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
fetch-depth: 2
|
|
- name: Checkout submodules
|
|
run: |
|
|
git submodule update --init --recursive
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo add-apt-repository -y universe
|
|
sudo add-apt-repository -y multiverse
|
|
sudo apt update
|
|
sudo apt install -y gcc-12 g++-12 wget libsdl2-2.0-0 libsdl2-dev mesa-utils xvfb
|
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10
|
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10
|
|
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
|
|
sudo update-alternatives --set cc /usr/bin/gcc
|
|
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
|
|
sudo update-alternatives --set c++ /usr/bin/g++
|
|
sudo update-alternatives --config gcc
|
|
sudo update-alternatives --config g++
|
|
wget https://cdn.ensoft.dev/eepp-assets/premake-5.0.0-beta6-linux.tar.gz
|
|
tar xvzf premake-5.0.0-beta6-linux.tar.gz
|
|
- name: Build
|
|
run: |
|
|
./premake5 --with-text-shaper --disable-static-build gmake
|
|
cd make/linux
|
|
make all -j$(nproc) -e config=release_x86_64
|
|
- name: Unit Tests
|
|
run: |
|
|
cd bin/unit_tests
|
|
xvfb-run ./eepp-unit_tests
|
|
- name: Upload test artifacts if folder exists
|
|
if: always()
|
|
run: |
|
|
if [ -d bin/unit_tests/output ]; then
|
|
echo "Artifact folder exists (bin/unit_tests/output), uploading..."
|
|
exit 0
|
|
else
|
|
echo "No artifact folder (bin/unit_tests/output), tests passed, skipping upload."
|
|
exit 0
|
|
fi
|
|
id: upload-check
|
|
- name: Upload artifacts
|
|
if: always() && steps.upload-check.outputs.result == '0' && exists('bin/unit_tests/output')
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: linux-test-output
|
|
path: bin/unit_tests/output/*
|