-
Notifications
You must be signed in to change notification settings - Fork 43
137 lines (129 loc) Β· 4.5 KB
/
ci.yaml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
on:
push:
branches:
- main
tags:
- "*"
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: CI
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
components: "clippy, rustfmt"
- uses: Swatinem/rust-cache@v2
# make sure all code has been formatted with rustfmt
- run: cargo fmt -- --check --color always
# run clippy to verify we have no warnings
- run: cargo clippy --all-features --all-targets -- -D warnings
cargo-deny:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
test_debug:
name: Test (Debug)
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-22.04
target: aarch64-unknown-linux-gnu
container: ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: macOS-12
target: x86_64-apple-darwin
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
env:
TARGET_CXX: "${{ matrix.target == 'aarch64-unknown-linux-gnu' && 'g++' || 'clang++' }}"
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --target ${{ matrix.target }}
- name: test - no features
run: cargo test --workspace --exclude pxbind
- name: test - all features
run: cargo test --all-features --workspace --exclude pxbind
- name: ball all features
run: cargo run --example ball --all-features
- name: ball no features
run: cargo run --example ball
- name: ball just structgen
run: cargo run -p physx --example ball_physx --features structgen
build_debug_aarch64_apple_darwin:
name: Build aarch64-apple-darwin
strategy:
matrix:
include:
- os: macOS-12
target: aarch64-apple-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --target ${{ matrix.target }}
- name: build
run: cargo build -p physx
package:
name: Package
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo package --manifest-path ./physx-sys/Cargo.toml
build_android_release:
name: Build (Release) (aarch64-linux-android)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Set up NDK 21.4.7075529
run: |
ANDROID_ROOT=/usr/local/lib/android
ANDROID_SDK_ROOT=${ANDROID_ROOT}/sdk
ANDROID_NDK_ROOT=${ANDROID_SDK_ROOT}/ndk-bundle
SDKMANAGER=${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager
echo "y" | $SDKMANAGER "ndk;21.4.7075529"
ln -sfn ${ANDROID_SDK_ROOT}/ndk/21.4.7075529 ${ANDROID_NDK_ROOT}
echo "ANDROID_NDK_HOME=${ANDROID_NDK_ROOT}" >> $GITHUB_ENV
- uses: actions/checkout@v3
with:
submodules: true
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-linux-android
- uses: Swatinem/rust-cache@v2
- run: cargo fetch --target aarch64-linux-android --manifest-path physx/Cargo.toml
- name: build - no features
env:
LD_aarch64_linux_android: ${{env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld
CC_aarch64_linux_android: ${{env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang
CXX_aarch64_linux_android: ${{env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++
AR_aarch64_linux_android: ${{env.ANDROID_NDK_HOME }}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
run: cargo build --target aarch64-linux-android --release -p physx