From 9a6558870112040a278c44d3ff941bd91c3a8b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=81nis?= <97699850+janisslsm@users.noreply.github.com> Date: Wed, 25 Oct 2023 18:59:21 +0300 Subject: [PATCH] fixed linux CI --- .github/workflows/linux.yml | 87 +++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/workflows/linux.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..219e491 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,87 @@ +######################################## +# 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