Skip to content

Commit 6f45d8d

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

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
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 install resalloc-kubernetes --root . --target aarch64-unknown-linux-gnu
30+
cargo install resalloc-kubernetes --root .

0 commit comments

Comments
 (0)