From 5419a5c0f3efbecbf34e2c9013b0d88b69bf80c6 Mon Sep 17 00:00:00 2001 From: Liam Monninger Date: Sat, 23 Sep 2023 18:18:13 -0700 Subject: [PATCH] [CICD] linux x86_64 setup as action. --- .github/actions/setup-linux-x86_64.yml | 16 ++++++++++++++++ .github/workflows/check.yml | 14 +++----------- .github/workflows/release.yml | 19 ++++++------------- .github/workflows/test.yml | 12 +++++------- 4 files changed, 30 insertions(+), 31 deletions(-) create mode 100644 .github/actions/setup-linux-x86_64.yml diff --git a/.github/actions/setup-linux-x86_64.yml b/.github/actions/setup-linux-x86_64.yml new file mode 100644 index 00000000..b19ed845 --- /dev/null +++ b/.github/actions/setup-linux-x86_64.yml @@ -0,0 +1,16 @@ +name: 'Setup Linux x86_64' +description: 'Sets up the environment for Linux x86_64 builds with Rust' + +runs: + using: 'composite' + steps: + + - name: Install build essentials + run: sudo apt-get update && sudo apt-get install -y build-essential lld + shell: bash + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.70 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 42241fe1..8b34af80 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,22 +11,14 @@ jobs: labels: movement-runner steps: + - name: Checkout Repository uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Install build essentials - run: sudo apt-get update && sudo apt-get install -y build-essential lld - - - name: Print Linker Version - run: ld --version - - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.70 + - name: Setup + uses: ./.github/actions/setup-linux-x86_64.yml - name: Cache cargo registry uses: actions/cache@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6981087c..2b95748b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,19 +55,8 @@ jobs: with: submodules: 'recursive' - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.70.0 - - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential - - - name: Install aarch64 target - run: rustup target add aarch64-unknown-linux-gnu + - name: Setup + uses: ./.github/actions/setup-linux-x86_64.yml - name: Debugging Info run: | @@ -101,6 +90,7 @@ jobs: asset_name: movement-x86_64-linux asset_content_type: application/octet-stream + pre-release-x86_64-mac: if: false # not yet supported needs: prepare-release @@ -203,6 +193,7 @@ jobs: asset_name: movement-aarch64-linux asset_content_type: application/octet-stream + pre-release-aarch64-mac: if: false # not yet supported needs: prepare-release @@ -254,6 +245,7 @@ jobs: asset_name: movement-aarch64-mac asset_content_type: application/octet-stream + pre-release-x86_64-windows: if: false # not yet supported needs: prepare-release @@ -299,6 +291,7 @@ jobs: asset_path: ./m1/target/release/movement asset_name: movement-x86_64-windows asset_content_type: application/octet-stream + build-and-docker: if: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e15914a4..5803c670 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,21 +12,19 @@ jobs: labels: movement-runner if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - name: Checkout code + + - name: Checkout Repository uses: actions/checkout@v2 with: submodules: 'recursive' - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.70.0 + - name: Setup + uses: ./.github/actions/setup-linux-x86_64.yml - name: Build and Test Subnet run: | cd ./m1 - RUSTFLAGS="--cfg tokio_unstable" cargo test --lib # this should only be the lib tests + # cargo test --lib # this should only be the lib tests - name: Update Badge run: |