From 3efcc1eacce57659fefefc4dd7d8c16728cd0c28 Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 14:40:15 -0500 Subject: [PATCH 1/6] incl. `actions/stale` --- .github/workflows/stale.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000..59525ef --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,16 @@ +name: 'Close stale issues & PRs' +on: + schedule: + - cron: '30 1 * * *' + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v6 + with: + stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' + stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.' + close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' + days-before-stale: 30 + days-before-close: 5 From 9c3bac99984cfc986eafe9c1cfa2c62fba11d76c Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 14:50:26 -0500 Subject: [PATCH 2/6] base refactor `build.xml` --- .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ .github/workflows/check.yml | 44 ------------------------------------- 2 files changed, 44 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4e5805b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +on: [push] + +name: Build + +jobs: + check: + name: Rust project + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: wasm32-unknown-unknown + override: true + components: rustfmt, clippy + + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + args: --release + + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --release --all-features + + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + + - name: Report + uses: actions-rs/grcov@v0.1 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 6428ff9..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Check Set-Up & Build - -# Controls when the action will run. -on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [ main ] - pull_request: - branches: [ main ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - check: - # The type of runner that the job will run on - runs-on: ubuntu-20.04 - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - - name: Set-Up - run: sudo apt install -y git clang curl libssl-dev llvm libudev-dev - - - name: Install Rustup - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y - source ~/.cargo/env - rustup default stable - rustup update nightly - rustup update stable - rustup target add wasm32-unknown-unknown --toolchain nightly - - - name: Check Build - run: | - SKIP_WASM_BUILD=1 cargo check --release - - - name: Check Build for Benchmarking - run: > - pushd node && - cargo check --features=runtime-benchmarks --release From 6d8a7daaf7e750b6945e80ee6af831b86ae7fded Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 20:26:24 -0500 Subject: [PATCH 3/6] configure different stale timeouts per `README.md` --- .github/workflows/stale.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 59525ef..c7cbc5b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,5 @@ -name: 'Close stale issues & PRs' +name: Stale + on: schedule: - cron: '30 1 * * *' @@ -7,10 +8,14 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v6 + - name: Run + uses: actions/stale@v6 with: stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' - stale-pr-message: 'This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.' + stale-pr-message: 'This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.' close-issue-message: 'This issue was closed because it has been stalled for 5 days with no activity.' - days-before-stale: 30 - days-before-close: 5 + close-pr-message: 'This PR was closed because it has been stalled for 10 days with no activity.' + days-before-issue-stale: 30 + days-before-pr-stale: 45 + days-before-issue-close: 5 + days-before-pr-close: 10 From 6d3bd47c5cb26ce54076db838a698ad54d221931 Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 20:26:58 -0500 Subject: [PATCH 4/6] cleanup `build.xml` --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e5805b..3dd7bdc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,10 @@ -on: [push] - name: Build +on: [push] + jobs: - check: - name: Rust project + build: + name: Build runs-on: ubuntu-latest steps: - name: Checkout @@ -24,7 +24,7 @@ jobs: command: check args: --release - - name: Build + - name: Run uses: actions-rs/cargo@v1 with: command: build From fd3d42dd0ea26031e6044b1c54cf111c4572e866 Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 20:34:01 -0500 Subject: [PATCH 5/6] intl. `lint.yml` --- .github/workflows/lint.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..f809470 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,24 @@ +name: Lint + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup + uses: actions-rs/toolchain@v1 + with: + override: true + components: clippy + target: wasm32-unknown-unknown + toolchain: nightly + + - name: Run + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features From 5ccf481199e3efe240659575f1fe4906a8dde0a6 Mon Sep 17 00:00:00 2001 From: Austin Heap Date: Fri, 14 Oct 2022 20:34:26 -0500 Subject: [PATCH 6/6] separate concerns bt `build.yml` & `test.yml` --- .github/workflows/build.yml | 6 +++--- .github/workflows/test.yml | 38 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dd7bdc..e1802bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,10 @@ jobs: - name: Setup uses: actions-rs/toolchain@v1 with: - toolchain: nightly - target: wasm32-unknown-unknown override: true - components: rustfmt, clippy + components: clippy + target: wasm32-unknown-unknown + toolchain: nightly - name: Check uses: actions-rs/cargo@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..4e15ad8 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test + +on: [push] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup + uses: actions-rs/toolchain@v1 + with: + override: true + components: clippy + target: wasm32-unknown-unknown + toolchain: nightly + + - name: Check + uses: actions-rs/cargo@v1 + with: + command: check + args: --release + + - name: Test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --no-fail-fast + env: + CARGO_INCREMENTAL: '0' + RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' + + - name: Report + uses: actions-rs/grcov@v0.1