diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1d0e84f..61326f4 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,26 +23,23 @@ jobs: os: - ubuntu-latest - toolchain: - - 1.77.2 - steps: - uses: actions/checkout@v2 - - uses: extractions/setup-just@v1 + - uses: taiki-e/install-action@v2 with: - just-version: 1.25.2 + tool: just@1.25.2,cross@0.2.5 - uses: Swatinem/rust-cache@v2 with: key: ${{ runner.os }}-${{ hashFiles('Cargo.lock') }}-${{ matrix.toolchain }} - uses: dtolnay/rust-toolchain@master with: - toolchain: ${{ matrix.toolchain }} + toolchain: 1.77.2 + targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl - name: Install musl tools run: | sudo apt-get install -y musl-tools - rustup target add x86_64-unknown-linux-musl - - name: Build Musl binary - run: just cargo-build + - name: Build binary (x86 and ARM64) + run: just build-binaries - name: Generate artifacts run: just release-artifacts - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index a2f0266..05902d3 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -38,12 +38,13 @@ jobs: with: toolchain: ${{ matrix.toolchain }} components: clippy, rustfmt + targets: x86_64-unknown-linux-musl - uses: Swatinem/rust-cache@v2 - name: Musl Dependencies run: sudo apt install musl-tools -y if: runner.os == 'Linux' - name: Build application - run: just cargo-build-no-target + run: just cargo-build - name: Lint run: | just cargo-clippy-check diff --git a/justfile b/justfile index eca6565..bfa2021 100644 --- a/justfile +++ b/justfile @@ -4,12 +4,13 @@ default: # Build application cargo-build: - cargo build --release --locked --target x86_64-unknown-linux-musl - -# Build application (default target) -cargo-build-no-target: cargo build --release --locked +# Build binaries +build-binaries: + cargo build --release --locked --target x86_64-unknown-linux-musl + cross build --target aarch64-unknown-linux-musl --release + # Clippy check cargo-clippy-check: cargo clippy --release --no-deps --workspace --locked --tests -- -Dwarnings @@ -22,6 +23,7 @@ cargo-fmt-check: release-artifacts: mkdir -p artifacts cp target/x86_64-unknown-linux-musl/release/health-check ./artifacts/health-check-x86_64-unknown-linux-musl + cp target/aarch64-unknown-linux-musl/release/health-check ./artifacts/health-check-aarch64-unknown-linux-musl # Test 1: Will raise alert to slack test1: