From a9b30c8da1106c037bc69b25652e0cb752a3ad34 Mon Sep 17 00:00:00 2001 From: Li Chaoran Date: Fri, 30 Dec 2022 17:54:55 +0800 Subject: [PATCH 1/2] using openssl-src in place for openssl in cross-compile is not working Signed-off-by: Li Chaoran --- Cargo.toml | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 088958f..a8be1d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,8 @@ anyhow = {version = "1.0.66"} serde_json = { version = "1.0"} handlebars = { version = "4.3.5"} uuid = {version = "1.2.1", features= ["v4"]} +openssl = { version = "0.10.45", features = ["vendored"] } [[bin]] name = "resalloc-kubernetes" -path = "src/main.rs" \ No newline at end of file +path = "src/main.rs" diff --git a/README.md b/README.md index 18ad372..d865f70 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ Options: --namespace -h, --help Print help information -```` \ No newline at end of file +```` From bfe7e7d8586ef550c07578a96bfa0d5340fa996b Mon Sep 17 00:00:00 2001 From: Li Chaoran Date: Wed, 4 Jan 2023 11:23:25 +0800 Subject: [PATCH 2/2] add workflow to check compile works Signed-off-by: Li Chaoran --- .github/workflows/main.yml | 28 +++++++++++++++++++++++----- Cargo.toml | 2 +- README.md | 2 +- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 95357f7..bcde48a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,12 +1,30 @@ -on: push -name: Clippy check +on: [push, pull_request] +name: check jobs: - clippy_check: + check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly - run: rustup component add clippy - - uses: actions-rs/clippy-check@v1 + - name: prepare cross compile toolchain + run: | + sudo apt install -qq crossbuild-essential-arm64 libssl-dev + rustup target add aarch64-unknown-linux-gnu + + # specified linker, it's needed for cross compile on linux + cat >> ~/.cargo/config << EOF + [target.aarch64-unknown-linux-gnu] + linker = "aarch64-linux-gnu-gcc" + EOF + - name: clippy check + uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --all-features \ No newline at end of file + args: --all-features + - name: check cross compile + run: | + cargo build --target aarch64-unknown-linux-gnu + cargo build \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index a8be1d1..7660fdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,4 +28,4 @@ openssl = { version = "0.10.45", features = ["vendored"] } [[bin]] name = "resalloc-kubernetes" -path = "src/main.rs" +path = "src/main.rs" \ No newline at end of file diff --git a/README.md b/README.md index d865f70..18ad372 100644 --- a/README.md +++ b/README.md @@ -67,4 +67,4 @@ Options: --namespace -h, --help Print help information -```` +```` \ No newline at end of file