From 5cc36f2942c7a0d7ebc7e4be2d32a8b1c19c61b4 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Thu, 16 Sep 2021 15:35:54 +1000 Subject: [PATCH] Build CI for armv7 We cannot run the smoke tests for arm as all targets on Github are x86_64 --- .cargo/config.toml | 2 ++ .github/workflows/ci.yml | 29 ++++++++++++++++++++--------- rust-toolchain.toml | 4 ++++ 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 rust-toolchain.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..0c1c209 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.armv7-unknown-linux-gnueabihf] +linker = "arm-linux-gnueabihf-gcc" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 569885c..e1d0525 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,25 +53,36 @@ jobs: os: ubuntu-latest - target: x86_64-apple-darwin os: macos-latest + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - profile: minimal - override: true - toolchain: stable + - name: Setup rust toolchain + run: rustup show - uses: Swatinem/rust-cache@v1.3.0 - - run: cargo build --all-targets --all-features + - name: Install compiler for armhf arch + if: matrix.target == 'armv7-unknown-linux-gnueabihf' + run: | + sudo apt-get update + sudo apt-get install gcc-arm-linux-gnueabihf + - run: cargo build --target ${{ matrix.target }} - run: cargo test --workspace - name: Smoke test ${{ matrix.target }} binary + if: matrix.target != 'armv7-unknown-linux-gnueabihf' run: | - target/debug/maker --data-dir=/tmp/maker --generate-seed & + target/${{ matrix.target }}/debug/maker --data-dir=/tmp/maker --generate-seed & sleep 5s # Wait for maker to start - target/debug/taker --data-dir=/tmp/taker --generate-seed & + target/${{ matrix.target }}/debug/taker --data-dir=/tmp/taker --generate-seed & sleep 5s # Wait for taker to start curl --fail http://localhost:8000/api/alive curl --fail http://localhost:8001/api/alive + - name: Upload binaries + uses: actions/upload-artifact@v2 + with: + name: maker-and-taker-binaries-${{ matrix.target }} + path: | + target/${{ matrix.target }}/debug/maker + target/${{ matrix.target }}/debug/taker diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..4f39af3 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.55" +components = ["clippy"] +targets = ["armv7-unknown-linux-gnueabihf"]