From 9ec95a9740f481b60da07dc7585dc6956d203d5b Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Sun, 11 Jun 2023 06:01:56 +0000 Subject: [PATCH] ci: add a build check for aarch64-linux-android (#1124) * ci: add a build check for aarch64-linux-android * appease clippy * use 1.67.0 for Android due to NDK issue * remove sparse since it is default now for 1.70 and causes issues with older versions anyway --- .cirrus.yml | 1 - .github/workflows/build_releases.yml | 1 - .github/workflows/ci.yml | 22 ++++++++++++++++++++-- .github/workflows/coverage.yml | 1 - .github/workflows/deployment.yml | 1 - .github/workflows/nightly.yml | 1 - src/app/data_harvester/disks/other.rs | 2 +- 7 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 6e8b1428..74ae7375 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -38,7 +38,6 @@ env: CARGO_INCREMENTAL: 0 CARGO_PROFILE_DEV_DEBUG: 0 CARGO_HUSKY_DONT_INSTALL_HOOKS: true - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse test_task: auto_cancellation: false diff --git a/.github/workflows/build_releases.yml b/.github/workflows/build_releases.yml index 0232a863..fef31417 100644 --- a/.github/workflows/build_releases.yml +++ b/.github/workflows/build_releases.yml @@ -25,7 +25,6 @@ env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true COMPLETION_DIR: "target/tmp/bottom/completion/" MANPAGE_DIR: "target/tmp/bottom/manpage/" - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse # TODO: Maybe add retry job in case of timeouts? jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f181a629..20bd5e52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,6 @@ env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true COMPLETION_DIR: "target/tmp/bottom/completion/" MANPAGE_DIR: "target/tmp/bottom/manpage/" - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -231,6 +230,15 @@ jobs: rust: stable, } + # Android ARM64 + - { + os: "ubuntu-latest", + target: "aarch64-linux-android", + cross: true, + rust: 1.67.0, # See https://github.com/cross-rs/cross/issues/1222 for more details + no-default-features: true, + } + steps: - name: Checkout repository uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 @@ -248,14 +256,24 @@ jobs: key: ${{ matrix.info.target }} cache-all-crates: true - - name: Try building + - name: Try building with default features uses: ClementTsang/cargo-action@v0.0.3 + if: ${{ matrix.info.no-default-features != true }} with: command: build args: --all-targets --verbose --target=${{ matrix.info.target }} --locked use-cross: ${{ matrix.info.cross }} cross-version: 0.2.5 + - name: Try building with no features + uses: ClementTsang/cargo-action@v0.0.3 + if: ${{ matrix.info.no-default-features == true }} + with: + command: build + args: --all-targets --verbose --target=${{ matrix.info.target }} --locked --no-default-features + use-cross: ${{ matrix.info.cross }} + cross-version: 0.2.5 + completion: name: "CI Pass Check" needs: [supported, other-check] diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 18aa67d5..f6a02f12 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,7 +15,6 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_HUSKY_DONT_INSTALL_HOOKS: true - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9300edb4..842e4385 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -18,7 +18,6 @@ env: CARGO_INCREMENTAL: 0 CARGO_PROFILE_DEV_DEBUG: 0 CARGO_HUSKY_DONT_INSTALL_HOOKS: true - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse jobs: initialize-release-job: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b62244f0..d7ea523f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,6 @@ env: CARGO_INCREMENTAL: 0 CARGO_PROFILE_DEV_DEBUG: 0 CARGO_HUSKY_DONT_INSTALL_HOOKS: true - CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse jobs: # TODO: Add a pre-job check to skip if no change; may want to add something to check if there is a new rust version/week limit of skips? diff --git a/src/app/data_harvester/disks/other.rs b/src/app/data_harvester/disks/other.rs index 2cd1e2e3..6dac7e93 100644 --- a/src/app/data_harvester/disks/other.rs +++ b/src/app/data_harvester/disks/other.rs @@ -1,6 +1,6 @@ //! Fallback disk info using sysinfo. -use sysinfo::{DiskExt, System, SystemExt}; +use sysinfo::{DiskExt, SystemExt}; use crate::app::data_harvester::DataCollector;