Skip to content

Commit

Permalink
ci(label): rerequest check run
Browse files Browse the repository at this point in the history
  • Loading branch information
clearloop committed Aug 16, 2023
1 parent b867014 commit 04b6821
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 26 deletions.
42 changes: 41 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
37 changes: 12 additions & 25 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
});
}

0 comments on commit 04b6821

Please sign in to comment.