diff options
author | Lukasz Woznicki <75632179+makr11st@users.noreply.github.com> | 2021-07-07 13:09:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-07 13:09:26 +0100 |
commit | 56fa4f7268b74bf6e6130fa975194138c4157470 (patch) | |
tree | 5216f8b0ae1e0545db8ca374ee307addf55b5f1f /.github | |
parent | dd52f334c36fed9ae8da96348338a680dea892f6 (diff) |
Add build job for aarch64 (#317)
* Add build job for aarch64
* Use matrix strategy to build arm targets
* Add arm binaries strip
Signed-off-by: Lukasz Woznicki <lukasz.woznicki@softwareag.com>
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build-workflow.yml | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml index 5c5a6d1d..0bce1aee 100644 --- a/.github/workflows/build-workflow.yml +++ b/.github/workflows/build-workflow.yml @@ -82,13 +82,21 @@ jobs: name: examples_amd64 path: target/release/examples/sawtooth_publisher - build_armv7: + build_matrix_arm: name: Build tedge and mapper Debian for armv7 runs-on: Ubuntu-20.04 if: ${{ github.event.workflow_run.conclusion == 'success' }} - - env: - TARGET: armv7-unknown-linux-gnueabihf + strategy: + matrix: + # Currently only arm targets, as we use a custom strip binary ! + target: + [ + aarch64-unknown-linux-gnu, + aarch64-unknown-linux-musl, + arm-unknown-linux-gnueabihf, + armv7-unknown-linux-gnueabihf, + armv7-unknown-linux-musleabihf, + ] steps: - name: checkout @@ -99,7 +107,7 @@ jobs: uses: actions-rs/toolchain@v1 with: toolchain: stable - target: ${{ env.TARGET}} + target: ${{ matrix.target }} override: true - name: Enable cache @@ -126,35 +134,39 @@ jobs: with: use-cross: true command: build - args: --release --target=${{ env.TARGET }} + args: --release --target=${{ matrix.target }} - - name: strip binaries (cargo deb fails to strip) - # TODO This does not seem to work right - uses: actions-rs/cargo@v1 - # https://github.com/marketplace/actions/rust-cargo - with: - command: strip + # armv7 uses `arm-linux-gnueabihf-strip`; aarch64 uses `aarch64-linux-gnu-strip` + # It appears `aarch64-linux-gnu-strip` seems to work explicitly on other arm bins but not other way around. + - name: Install binutils to add `strip` for striping arm binaries + run: sudo apt-get --assume-yes install binutils-arm-linux-gnueabihf binutils-aarch64-linux-gnu + + - name: Strip tedge + run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge + + - name: Strip tedge_mapper + run: arm-linux-gnueabihf-strip target/${{ matrix.target }}/release/tedge_mapper || aarch64-linux-gnu-strip target/${{ matrix.target }}/release/tedge_mapper - name: build tedge debian package for target uses: actions-rs/cargo@v1 # https://github.com/marketplace/actions/rust-cargo with: command: deb - args: -p tedge --no-strip --no-build --target=${{ env.TARGET }} + args: -p tedge --no-strip --no-build --target=${{ matrix.target }} - name: build tedge_mapper debian package for target uses: actions-rs/cargo@v1 # https://github.com/marketplace/actions/rust-cargo with: command: deb - args: -p tedge_mapper --no-strip --no-build --target=${{ env.TARGET }} - + args: -p tedge_mapper --no-strip --no-build --target=${{ matrix.target }} + - name: build tedge_apt_plugin debian package for target uses: actions-rs/cargo@v1 # https://github.com/marketplace/actions/rust-cargo with: command: deb - args: -p tedge_apt_plugin --no-strip --no-build --target=${{ env.TARGET }} + args: -p tedge_apt_plugin --no-strip --no-build --target=${{ matrix.target }} - name: build examples uses: actions-rs/cargo@v1 @@ -162,18 +174,18 @@ jobs: with: use-cross: true command: build - args: --release --examples --target=${{ env.TARGET }} + args: --release --examples --target=${{ matrix.target }} - name: upload debian packages as zip # https://github.com/marketplace/actions/upload-a-build-artifact uses: actions/upload-artifact@v2 with: - name: debian-packages-armhf - path: target/${{ env.TARGET }}/debian/*.deb + name: debian-packages-${{ matrix.target }} + path: target/${{ matrix.target }}/debian/*.deb - name: upload examples as zip # https://github.com/marketplace/actions/upload-a-build-artifact uses: actions/upload-artifact@v2 with: - name: examples_armhf - path: target/armv7-unknown-linux-gnueabihf/release/examples/sawtooth_publisher + name: examples_${{ matrix.target }} + path: target/${{ matrix.target }}/release/examples/sawtooth_publisher |