@@ -17,12 +17,14 @@ jobs:
17
17
- name : Check Formatting
18
18
run : cargo +stable fmt --all -- --check
19
19
20
- Tests :
20
+ tests :
21
+ name : Tests
21
22
strategy :
22
23
fail-fast : false
23
24
matrix :
24
- rust_version : [stable, nightly]
25
+ rust_version : [1.57.0, stable, nightly]
25
26
platform :
27
+ # Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml!
26
28
- { target: x86_64-pc-windows-msvc, os: windows-latest, }
27
29
- { target: i686-pc-windows-msvc, os: windows-latest, }
28
30
- { target: x86_64-pc-windows-gnu, os: windows-latest, host: -x86_64-pc-windows-gnu }
@@ -42,10 +44,12 @@ jobs:
42
44
env :
43
45
RUST_BACKTRACE : 1
44
46
CARGO_INCREMENTAL : 0
47
+ PKG_CONFIG_ALLOW_CROSS : 1
45
48
RUSTFLAGS : " -C debuginfo=0 --deny warnings"
46
49
OPTIONS : ${{ matrix.platform.options }}
47
50
FEATURES : ${{ format(',{0}', matrix.platform.features ) }}
48
51
CMD : ${{ matrix.platform.cmd }}
52
+ RUSTDOCFLAGS : -Dwarnings
49
53
50
54
runs-on : ${{ matrix.platform.os }}
51
55
steps :
@@ -61,22 +65,26 @@ jobs:
61
65
with :
62
66
rust-version : ${{ matrix.rust_version }}${{ matrix.platform.host }}
63
67
targets : ${{ matrix.platform.target }}
68
+ components : clippy
64
69
70
+ - name : Setup NDK path
71
+ shell : bash
72
+ # "Temporary" workaround until https://github.com/actions/virtual-environments/issues/5879#issuecomment-1195156618
73
+ # gets looked into.
74
+ run : echo "ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME" >> $GITHUB_ENV
75
+ - name : Install Linux dependencies
76
+ if : (matrix.platform.os == 'ubuntu-latest')
77
+ run : sudo apt-get update && sudo apt-get install pkg-config cmake libfreetype6-dev libfontconfig1-dev
65
78
- name : Install GCC Multilib
66
79
if : (matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')
67
- run : sudo apt-get update && sudo apt-get install gcc-multilib
80
+ run : sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install g++-multilib gcc-multilib libfreetype6-dev:i386 libfontconfig1-dev:i386
68
81
- name : Install cargo-apk
69
82
if : contains(matrix.platform.target, 'android')
70
83
run : cargo install cargo-apk
71
84
72
85
- name : Check documentation
73
86
shell : bash
74
- if : matrix.platform.target != 'wasm32-unknown-unknown'
75
- run : cargo $CMD doc --no-deps --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
76
-
77
- - name : Build
78
- shell : bash
79
- run : cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
87
+ run : cargo $CMD doc --no-deps --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES --document-private-items
80
88
81
89
- name : Build tests
82
90
shell : bash
@@ -89,10 +97,10 @@ jobs:
89
97
!contains(matrix.platform.target, 'wasm32'))
90
98
run : cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
91
99
92
-
93
- - name : Build with serde enabled
100
+ - name : Lint with clippy
94
101
shell : bash
95
- run : cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
102
+ if : (matrix.rust_version == '1.57.0') && !contains(matrix.platform.options, '--no-default-features')
103
+ run : cargo clippy --all-targets --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES -- -Dwarnings
96
104
97
105
- name : Build tests with serde enabled
98
106
shell : bash
0 commit comments