Merge pull request #411 from janisslsm/linux-ci #882
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################## | |
# BletchMAME Linux Github Action # | |
######################################## | |
name: Linux | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
cxx: [clang++-15, g++] | |
build_type: [Debug, Release] | |
qt: [6.2.1, 6.4.0] | |
runs-on: ubuntu-22.04 | |
steps: | |
# Checks out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Install Qt | |
- name: Install Qt | |
uses: jurplel/install-qt-action@v2 | |
with: | |
version: ${{ matrix.qt }} | |
modules: 'qt5compat' | |
dir: ${{ github.workspace }} | |
# Install Packages | |
- name: Install Packages | |
run: | | |
sudo apt update | |
sudo apt install -y freeglut3-dev libalut-dev libasound2-dev libc6-dev libgl1-mesa-dev libglu1-mesa-dev llvm-15 libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev mesa-utils pkg-config xorg-dev xvfb | |
# Retrieve QuaZip | |
- name: Retrieve QuaZip | |
run: | | |
git submodule update --init deps/quazip | |
# Retrieve lzma-c-sdk | |
- name: Retrieve lzma-c-sdk | |
run: | | |
git submodule update --init deps/lzma-c-sdk | |
# Build QuaZip | |
- name: Build QuaZip | |
run: | | |
cmake -Sdeps/quazip -Bdeps/build/ubuntu/quazip -DQUAZIP_QT_MAJOR_VERSION=6 | |
cmake --build deps/build/ubuntu/quazip --parallel | |
cmake --install deps/build/ubuntu/quazip --prefix deps/install/ubuntu | |
# Build lzma-c-sdk | |
- name: Build lzma-c-sdk | |
run: | | |
cmake -Sdeps/lzma-c-sdk -Bdeps/build/ubuntu/lzma-c-sdk -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
cmake --build deps/build/ubuntu/lzma-c-sdk --parallel | |
cmake --install deps/build/ubuntu/lzma-c-sdk --prefix deps/install/ubuntu | |
# Generate version.gen.h | |
- name: Generate version.gen.h | |
run: | | |
mkdir -p ./include | |
git describe --tags | perl scripts/process_version.pl --versionhdr > ./include/version.gen.h | |
# Build BletchMAME | |
- name: Build BletchMAME | |
run: | | |
cmake . -DHAS_VERSION_GEN_H=1 -D CMAKE_CXX_COMPILER=${{ matrix.cxx }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_PREFIX_PATH=deps/install/ubuntu -DLZMA_INCLUDE_DIR=deps/install/ubuntu/include | |
make -j 8 | |
strip ./BletchMAME | |
# Run Acceptance Tests | |
- name: Run Acceptance Tests | |
run: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/Qt/${{ matrix.qt }}/gcc_64/lib:deps/install/ubuntu/lib/x86_64-linux-gnu ; ./BletchMAME_tests |