-
Notifications
You must be signed in to change notification settings - Fork 478
79 lines (75 loc) · 2.43 KB
/
CI.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
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI
on:
push:
pull_request:
jobs:
build-vcpkg:
name: build vcpkg
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Install cargo-vcpkg
run: cargo install cargo-vcpkg
- name: Install dependencies
run: cargo vcpkg -v build
- name: Build SDL2
shell: bash
env:
CI_BUILD_FEATURES: "use-vcpkg static-link gfx image ttf mixer"
RUST_TEST_THREADS: 1
run: |
set -xeuo pipefail
rustc --version
cargo --version
cargo build --features "${CI_BUILD_FEATURES}"
cargo build --examples --features "${CI_BUILD_FEATURES}"
cargo test --features "${CI_BUILD_FEATURES}"
build-bundled:
name: build bundled
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
feature: ["", "static-link"]
build_mode: ["", "--release"]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Build SDL2
shell: bash
env:
# Bundled doesn't yet support gfx, image, ttf, mixer.
CI_BUILD_FEATURES: "bundled"
RUST_TEST_THREADS: 1
run: |
set -xeuo pipefail
rustc --version
cargo --version
cargo build --features "${CI_BUILD_FEATURES} ${{matrix.feature}}" ${{matrix.build_mode}}
cargo build --examples --features "${CI_BUILD_FEATURES} ${{matrix.feature}}" ${{matrix.build_mode}}
cargo test --features "${CI_BUILD_FEATURES} ${{matrix.feature}}" ${{matrix.build_mode}}
build-linux:
name: build linux pkg-config
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y libsdl2-dev libsdl2-mixer-dev libsdl2-gfx-dev libsdl2-image-dev libsdl2-ttf-dev
- name: Build SDL2
shell: bash
env:
CI_BUILD_FEATURES: "gfx image ttf mixer"
RUST_TEST_THREADS: 1
run: |
set -xeuo pipefail
rustc --version
cargo --version
# SDL 2.0.10 so no hidapi
cargo build --no-default-features --features "${CI_BUILD_FEATURES}"
cargo test --no-default-features --features "${CI_BUILD_FEATURES}"