From f105836b8c520dea285f8da581f8893cbcc95644 Mon Sep 17 00:00:00 2001 From: Mathew Richmond Date: Thu, 12 Oct 2023 13:13:28 -0600 Subject: [PATCH] Build rust binaries in build step --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++++++- .github/workflows/build_arm_nix.yml | 42 ---------------------------- 2 files changed, 42 insertions(+), 43 deletions(-) delete mode 100644 .github/workflows/build_arm_nix.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3a23a7df6..160e5a54de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,7 +61,48 @@ jobs: - name: Upload Binaries uses: actions/upload-artifact@v3 with: - name: binaries-${{ matrix.just_variants }} + name: binaries-amd64-${{ matrix.just_variants }} + path: | + target/debug/examples/counter + target/debug/examples/libp2p-multi-validator + target/debug/examples/libp2p-orchestrator + target/debug/examples/libp2p-validator + target/debug/examples/multi-validator + target/debug/examples/multi-web-server + target/debug/examples/web-server + target/debug/examples/web-server-da-orchestrator + target/debug/examples/web-server-da-validator + + build-arm: + strategy: + matrix: + just_variants: + - async_std + - tokio + runs-on: [self-hosted, arm64] + steps: + - name: Fix permissions + run: sudo chown -R runner1 /home/runner1/actions-runner/_work/HotShot + + - uses: actions/checkout@v4 + name: Checkout Repository + + - name: Install Rust Stable + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + name: Enable Rust Caching + with: + shared-key: "" + prefix-key: arm-${{ matrix.just_variants }} + + - name: Build all crates in workspace + run: just ${{ matrix.just_variants }} build + + - name: Upload Binaries + uses: actions/upload-artifact@v3 + with: + name: binaries-aarch64-${{ matrix.just_variants }} path: | target/debug/examples/counter target/debug/examples/libp2p-multi-validator diff --git a/.github/workflows/build_arm_nix.yml b/.github/workflows/build_arm_nix.yml deleted file mode 100644 index 3b9de0e1d4..0000000000 --- a/.github/workflows/build_arm_nix.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build Workflow for ARM - -on: - push: - branches: - - 'main' - - 'develop' - pull_request: - branches: - - 'main' - - '*/*' - - 'develop' - schedule: - - cron: '0 0 * * 1' - workflow_dispatch: - -jobs: - build: - runs-on: [self-hosted, arm64] - container: - image: ghcr.io/espressosystems/nix:main - volumes: - - github_nix:/nix - steps: - - uses: styfle/cancel-workflow-action@0.12.0 - name: Cancel Outdated Builds - with: - all_but_latest: true - access_token: ${{ github.token }} - - - uses: cachix/cachix-action@v12 - with: - name: espresso-systems-private - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - - name: Checkout Repository - uses: actions/checkout@v4 - - # sanity check that repository builds with nix - - name: Build - run: | - nix develop -c just async_std build