From 04b6821170910ea83862dd2a9b41dfa77e816b00 Mon Sep 17 00:00:00 2001 From: clearloop <26088946+clearloop@users.noreply.github.com> Date: Wed, 16 Aug 2023 14:42:50 +0400 Subject: [PATCH] ci(label): rerequest check run --- .github/workflows/build.yml | 42 ++++++++++++++++++++++++++++++++++++- .github/workflows/label.yml | 37 +++++++++++--------------------- 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 56f15a20871..56712d14826 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -250,4 +250,44 @@ jobs: macos-x86: if: ${{ always() && inputs.macos }} needs: linux - uses: ./.github/workflows/build-macos.yml + runs-on: macos-latest + env: + RUSTUP_HOME: /tmp/rustup_home + steps: + - name: "ACTIONS: Checkout" + uses: actions/checkout@v3 + + - name: "ACTIONS: Setup caching" + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- + + - name: "Install: protobuf" + run: brew install protobuf + + - name: "Install: Rust toolchain" + uses: dsherret/rust-toolchain-file@v1 + + - name: "Install: cargo-nextest" + run: curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin + + - name: "Build: Node" + run: >- + cargo build + -p gear-cli --features=lazy-pages + + - name: "Test: Lazy pages" + run: >- + cargo nextest run + -p "pallet-*" + -p gear-lazy-pages + -p gear-runtime-interface + --features=lazy-pages diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index ede8b797193..30648ecbdcc 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -10,9 +10,9 @@ concurrency: cancel-in-progress: true jobs: - build: + lbuild: runs-on: ubuntu-latest - # if: github.event.label.name == 'A0-pleasereview' || github.event.label.name == 'E2-forcemacos' + if: github.event.label.name == 'A0-pleasereview' || github.event.label.name == 'E2-forcemacos' steps: - uses: actions/github-script@v6 id: label-checks @@ -48,28 +48,15 @@ jobs: }); for (run of check_runs) { - console.log(run.name); - if (run.name === "build / linux") { - linux = false; - } else if (run.name === "build-macos / x86") { - macos = false; + if (run.conclusion !== "skipped") continue; + if ( + (linux && run.name === "build") || + (macos && run.name === "build / macos-x86") + ) { + await github.rest.checks.rerequestRun({ + owner, + repo, + check_run_id: run.id, + }); } } - - if (linux) { - await github.rest.actions.createWorkflowDispatch({ - owner, - repo, - workflow_id: "build.yml", - ref - }); - } - - if (macos) { - await github.rest.actions.createWorkflowDispatch({ - owner, - repo, - workflow_id: "build-macos.yml", - ref - }); - }