-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (61 loc) · 2.26 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Download apt packages
run: |
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 libsfml-dev libcsfml-dev bison
- 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.0-sources.zip --no-check-certificate
unzip -q SFML-2.6.0-sources.zip
pushd SFML-2.6.0 && 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:
crate: cargo-tarpaulin
version: latest
use-tool-cache: true
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
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: |
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