diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae3a6a4..4e36e48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ env: CARGO_TERM_COLOR: always jobs: - build: + x64: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.2.2 @@ -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 diff --git a/eng/build.sh b/eng/build.sh index 59c91b9..1f4f11a 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -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 diff --git a/eng/setup.sh b/eng/setup.sh index f5103be..0bdcf0e 100755 --- a/eng/setup.sh +++ b/eng/setup.sh @@ -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