From c96092bee3982e38626b48bc261443899b869c7e Mon Sep 17 00:00:00 2001 From: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com> Date: Mon, 29 Jan 2024 13:24:45 +0800 Subject: [PATCH] Fixed building issues for SFML 2.6 This SFML version is not available in ubuntu 22 we are using with GithubActions, so we have to build SFML ourselves --- .github/workflows/rust.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 65fe742..40efaee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -18,7 +18,24 @@ jobs: steps: - name: Download apt packages run: | - sudo apt-get update -y && sudo apt-get install -y bison libsfml-dev libcsfml-dev libasound2-dev + sudo apt-get update -y + sudo apt-get install -y libpthread-stubs0-dev libgl1-mesa-dev libx11-dev libx11-xcb-dev libxcb-image0-dev libxrandr-dev libxcb-randr0-dev libudev-dev libfreetype6-dev libglew-dev libjpeg8-dev libgpgme11-dev libsndfile1-dev libopenal-dev libjpeg62 libxcursor-dev cmake libclang-dev clang libasound2-dev bison libcsfml-dev + - name: Set up SFML + run: | + set -e + mkdir sfml_install + # TODO: Maybe investigate why the certificate checks for the SFML sources fail + wget https://www.sfml-dev.org/files/SFML-2.6.1-sources.zip --no-check-certificate + unzip -q SFML-2.6.1-sources.zip + pushd SFML-2.6.1 && mkdir build && cd build && cmake .. && make + make DESTDIR=$GITHUB_WORKSPACE/sfml_install install + popd + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + target: x86_64-unknown-linux-gnu - name: Install cargo-tarpaulin uses: actions-rs/install@v0.1 with: @@ -37,7 +54,13 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - name: Build - run: cargo build --verbose + run: | + export SFML_INCLUDE_DIR=$GITHUB_WORKSPACE/sfml_install/usr/local/include + export SFML_LIBS_DIR=$GITHUB_WORKSPACE/sfml_install/usr/local/lib + cargo build --verbose - name: Run tests - run: sh ./.github/install_and_run_tests.sh + run: | + export SFML_INCLUDE_DIR=$GITHUB_WORKSPACE/sfml_install/usr/local/include + export SFML_LIBS_DIR=$GITHUB_WORKSPACE/sfml_install/usr/local/lib + sh ./.github/install_and_run_tests.sh - uses: codecov/codecov-action@v1.0.11