Skip to content

Commit

Permalink
add support for arm64 builds (#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoray authored Feb 6, 2025
1 parent 3724e9d commit 5e8e85d
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 13 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
CARGO_TERM_COLOR: always

jobs:
build:
x64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
Expand All @@ -24,7 +24,24 @@ jobs:
- name: upload artifacts
uses: actions/upload-artifact@v4.6.0
with:
name: build-artifacts
name: linux-x86-64-artifacts
path: |
target/*/release/avml
target/*/release/avml-minimal
target/*/release/avml-convert
target/*/release/avml-upload
arm64:
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v4.2.2
- name: build
run: eng/ci.sh
- name: Run tests
run: sudo target/aarch64-unknown-linux-musl/release/avml --compress output.lime
- name: upload artifacts
uses: actions/upload-artifact@v4.6.0
with:
name: linux-aarch64-artifacts
path: |
target/*/release/avml
target/*/release/avml-minimal
Expand Down
22 changes: 12 additions & 10 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ set -uvex -o pipefail

cd $(dirname ${BASH_SOURCE[0]})/../

ARCH=$(uname -m)

typos

cargo fmt -- --check
cargo semver-checks check-release
cargo clippy --locked --all-targets --all-features -- -D warnings -D clippy::pedantic -A clippy::missing_errors_doc
cargo test --release --target x86_64-unknown-linux-musl --locked --all-targets --all-features
cargo test --release --target ${ARCH}-unknown-linux-musl --locked --all-targets --all-features
for FEATURE in $(cargo metadata --locked --format-version 1 | jq '.packages | [.[] | select(.name=="avml")][0].features | keys | @tsv' -r); do
cargo check --release --target x86_64-unknown-linux-musl --locked --no-default-features --features ${FEATURE} --features native-tls
cargo check --release --target ${ARCH}-unknown-linux-musl --locked --no-default-features --features ${FEATURE} --features native-tls
done
cargo build --release --no-default-features --target x86_64-unknown-linux-musl --locked
cp target/x86_64-unknown-linux-musl/release/avml target/x86_64-unknown-linux-musl/release/avml-minimal
cargo build --release --target x86_64-unknown-linux-musl --locked
cargo build --release --target x86_64-unknown-linux-musl --locked --bin avml-upload --features "put blobstore status"
strip target/x86_64-unknown-linux-musl/release/avml
strip target/x86_64-unknown-linux-musl/release/avml-minimal
strip target/x86_64-unknown-linux-musl/release/avml-convert
strip target/x86_64-unknown-linux-musl/release/avml-upload
cargo build --release --no-default-features --target ${ARCH}-unknown-linux-musl --locked
cp target/${ARCH}-unknown-linux-musl/release/avml target/${ARCH}-unknown-linux-musl/release/avml-minimal
cargo build --release --target ${ARCH}-unknown-linux-musl --locked
cargo build --release --target ${ARCH}-unknown-linux-musl --locked --bin avml-upload --features "put blobstore status"
strip target/${ARCH}-unknown-linux-musl/release/avml
strip target/${ARCH}-unknown-linux-musl/release/avml-minimal
strip target/${ARCH}-unknown-linux-musl/release/avml-convert
strip target/${ARCH}-unknown-linux-musl/release/avml-upload
2 changes: 1 addition & 1 deletion eng/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -uvex -o pipefail
DEBIAN_FRONTEND=noninteractive sudo apt-get install musl-dev musl-tools musl jq

rustup component add rustfmt
rustup target add x86_64-unknown-linux-musl
rustup target add $(uname -m)-unknown-linux-musl
rustup update stable
cargo install typos-cli
cargo install cargo-semver-checks --locked

0 comments on commit 5e8e85d

Please sign in to comment.