-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
122 lines (102 loc) · 3.38 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
toolchain: [stable, nightly]
os: [windows-2019, ubuntu-20.04, macos-10.15]
exclude:
- os: macos-10.15
toolchain: nightly
- os: windows-2019
toolchain: nightly
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install alsa
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
if: ${{ runner.os == 'Linux' }}
- name: Install udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
if: ${{ runner.os == 'Linux' }}
- name: Build
run: cargo check
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
- name: Run tests
run: cargo test --workspace
if: ${{ runner.os == 'Linux' }}
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"
build-wasm:
strategy:
matrix:
toolchain: [stable, nightly]
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
needs: clean
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: wasm32-unknown-unknown
override: true
- uses: actions/cache@v2
with:
path: |
target
key: ${{ runner.os }}-cargo-check-test-${{ matrix.toolchain }}-${{ hashFiles('**/Cargo.lock') }}
- name: Check wasm
uses: actions-rs/cargo@v1
with:
command: check
args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf
build-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi
- name: Install Cargo APK
run: cargo install cargo-apk
- name: Build APK
run: cargo apk build --example android
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2020-12-07
components: rustfmt, clippy
override: true
- name: Install alsa
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev
- name: Install udev
run: sudo apt-get update; sudo apt-get install --no-install-recommends libudev-dev
- name: Check the format
run: cargo +nightly-2020-12-07 fmt --all -- --check
# type complexity must be ignored because we use huge templates for queries
# -A clippy::manual-strip: strip_prefix support was added in 1.45. we want to support earlier rust versions
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::type_complexity -A clippy::manual-strip