Skip to content

Commit c7839b8

Browse files
committed
add workflow to check compile works
Signed-off-by: Li Chaoran <[email protected]>
1 parent a9b30c8 commit c7839b8

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

.github/workflows/main.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
1-
on: push
2-
name: Clippy check
1+
on: [push, pull_request]
2+
name: check
33
jobs:
4-
clippy_check:
4+
check:
55
runs-on: ubuntu-latest
66
steps:
77
- uses: actions/checkout@v1
8+
- uses: actions-rs/toolchain@v1
9+
with:
10+
toolchain: nightly
811
- run: rustup component add clippy
9-
- uses: actions-rs/clippy-check@v1
12+
- name: prepare cross compile toolchain
13+
run: |
14+
sudo apt install -qq crossbuild-essential-arm64 libssl-dev
15+
rustup target add aarch64-unknown-linux-gnu
16+
17+
# specified linker, it's needed for cross compile on linux
18+
cat >> ~/.cargo/config << EOF
19+
[target.aarch64-unknown-linux-gnu]
20+
linker = "aarch64-linux-gnu-gcc"
21+
EOF
22+
- name: clippy check
23+
uses: actions-rs/clippy-check@v1
1024
with:
1125
token: ${{ secrets.GITHUB_TOKEN }}
12-
args: --all-features
26+
args: --all-features
27+
- name: check cross compile
28+
run: |
29+
cargo build resalloc-kubernetes --target aarch64-unknown-linux-gnu
30+
cargo build resalloc-kubernetes

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ openssl = { version = "0.10.45", features = ["vendored"] }
2828

2929
[[bin]]
3030
name = "resalloc-kubernetes"
31-
path = "src/main.rs"
31+
path = "src/main.rs"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ Options:
6767
--namespace <NAMESPACE>
6868
-h, --help Print help information
6969

70-
````
70+
````

0 commit comments

Comments
 (0)