Skip to content

Commit

Permalink
Fixed building issues for SFML 2.6
Browse files Browse the repository at this point in the history
This SFML version is not available in ubuntu 22 we are using with
GithubActions, so we have to build SFML ourselves
  • Loading branch information
Amjad50 committed Jan 29, 2024
1 parent 2f20f0a commit c96092b
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit c96092b

Please sign in to comment.