From f8af19898fd4c2c1c9bfa813bb667843a6217406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 10:32:57 +1200 Subject: [PATCH 1/6] Add bors --- .github/workflows/check.yml | 78 +++++++++++++------------------------ .github/workflows/main.yml | 28 +++++++++++++ .github/workflows/merge.yml | 63 ++++++++++++++++++++++++++++++ CARETAKERS.md | 39 ------------------- README.md | 12 +++--- bors.toml | 19 +++++++++ 6 files changed, 143 insertions(+), 96 deletions(-) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/merge.yml delete mode 100644 CARETAKERS.md create mode 100644 bors.toml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index d047ba7..ace3b95 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,22 +1,17 @@ +name: PR feedback on: pull_request: - push: - branches: - - main - - try/** - -name: Checks & Tests jobs: - check: + clippy: strategy: matrix: - platform: - - ubuntu - - windows - - macos + include: + - platform: macos + - platform: ubuntu + - platform: windows - name: Test on ${{ matrix.platform }} + name: Clippy on ${{ matrix.platform }} runs-on: "${{ matrix.platform }}-latest" steps: @@ -26,59 +21,42 @@ jobs: profile: minimal toolchain: stable override: true + - run: rustup component add clippy - uses: actions-rs/cargo@v1 with: - command: check - - uses: actions-rs/cargo@v1 - with: - command: check - args: --features windows-console - # check to make sure it keeps compiling, but this is unsupported buggy code for now + command: clippy - - uses: actions-rs/cargo@v1 - if: matrix.platform != 'windows' - with: - command: test - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --doc - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --test platformed terminfo - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --test platformed xterm - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --test platformed tput - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --test platformed windows_cls - # I've absolutely tested the windows_vt things LOCALLY but they DON'T WORK IN CI - # I don't know why and at this point I'm very very tired. If you know, help pls. - - if: matrix.platform == 'windows' - shell: powershell - run: cargo test --test platformed vt_ris - - if: matrix.platform == 'windows' - shell: powershell - run: cd tests/win10; cargo run + fmt-check: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true - uses: actions-rs/cargo@v1 with: - command: clippy + command: fmt + args: --check + + windows-console: + name: Check windows-console feature compiles + runs-on: windows-latest - msrv: - name: Check on MSRV - runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.51.0 + toolchain: stable override: true - uses: actions-rs/cargo@v1 with: command: check + args: --features windows-console + # check to make sure it keeps compiling, but this is unsupported buggy code for now diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..5d8014d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +name: Main branch +on: + push: + branches: + - main + +jobs: + check: + strategy: + matrix: + include: + - platform: macos + - platform: ubuntu + - platform: windows + + name: Check on ${{ matrix.platform }} + runs-on: "${{ matrix.platform }}-latest" + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + with: + command: check diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml new file mode 100644 index 0000000..b530466 --- /dev/null +++ b/.github/workflows/merge.yml @@ -0,0 +1,63 @@ +name: Merge (with Bors) +on: + push: + branches: + - staging + - trying + +jobs: + check: + strategy: + matrix: + include: + - platform: macos + toolchain: stable + - platform: macos + toolchain: 1.51.0 + - platform: ubuntu + toolchain: stable + - platform: ubuntu + toolchain: 1.51.0 + - platform: windows + toolchain: stable + - platform: windows + toolchain: 1.51.0 + + name: Test on ${{ matrix.platform }} with Rust ${{ matrix.toolchain }} + runs-on: "${{ matrix.platform }}-latest" + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: "${{ matrix.toolchain }}" + override: true + - run: rustup component add clippy + - uses: actions-rs/cargo@v1 + if: matrix.platform != 'windows' + with: + command: test + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --doc + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --test platformed terminfo + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --test platformed xterm + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --test platformed tput + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --test platformed windows_cls + # I've absolutely tested the windows_vt things LOCALLY but they DON'T WORK IN CI + # I don't know why and at this point I'm very very tired. If you know, help pls. + - if: matrix.platform == 'windows' + shell: powershell + run: cargo test --test platformed vt_ris + - if: matrix.platform == 'windows' + shell: powershell + run: cd tests/win10; cargo run diff --git a/CARETAKERS.md b/CARETAKERS.md deleted file mode 100644 index 1abfdf4..0000000 --- a/CARETAKERS.md +++ /dev/null @@ -1,39 +0,0 @@ -# Caretaker Maintainership - -_(If this file is included in a project, you can find the list of current caretakers at the bottom.)_ - -In a small classical open-source project, maintainers do a lot, and if maintainers don't have time to do a lot, usually the project stalls. -Finding new maintainers is hard because few people actively want to take over all the responsibilities of a project. -There must be a different way. - -With Caretaker Maintainership, "Maintainers" become "Caretakers". -Caretakers' only mandatory responsibility is to grant Releasers commit and publish access to the project. -Caretakers can of course still do other things as they wish. - -Releasers are one of three kinds of contributors to a Caretaker project: -- Reporters are people who report bugs -- Builders write code, docs, make art, proofread, etc, **and open pull requests** -- Releasers do final polish, add to changelogs, etc as needed, and publish new versions. - -You can of course have multiple roles. -A single-person project will have that person do all or almost all roles. -You're also not restricted to just these roles, or to follow them precisely. -Do whatever fits best! - -Someone who wishes to be a Releaser **must** open an issue or contact the Caretakers in some other way and ask, detailing what they want to do. -That can be as limited as "merge this feature" or as open-ended as "work on the project during my free time". -- If accepted, a Caretaker then gives enough rights or permissions to the new Releaser that they may cut new releases of the project on their own. -- If the Releasership is for a limited purpose, the Releaser loses their rights (either relinquishes them on their own or is taken out of permissions by Caretakers) after they've done their bit. - -**Caretaker maintainership is not suitable for commercial, high-stakes, or security projects!** - -Also you may want to use one of the badges below on your readme and/or add the #caretaker tag to your github description so: -- People who want to contribute to Caretaker projects can find them, and -- People who want to *avoid using* Caretaker projects for whatever reason can do that. - -[![Uses Caretaker Maintainership](https://badgen.net/badge/Caretaker/Maintainership%20👥%20/purple)](https://gist.github.com/passcod/7332390db1813f9bccb07e5cf3a9649b) -[![Uses Caretaker Maintainership](https://flat.badgen.net/badge/Caretaker/Maintainership%20👥%20/purple)](https://gist.github.com/passcod/7332390db1813f9bccb07e5cf3a9649b) - -## Current Caretakers - -- Félix Saparelli, @passcod on github and twitter diff --git a/README.md b/README.md index 4ce7a03..e749544 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![Crate release version](https://flat.badgen.net/crates/v/clearscreen)](https://crates.io/crates/clearscreen) -[![Crate license: Apache 2.0 or MIT](https://flat.badgen.net/badge/license/Apache%202.0%20or%20MIT)][copyright] -![MSRV: 1.51.0 (breaking)](https://flat.badgen.net/badge/MSRV/1.51.0%20%28breaking%29/green) -[![CI status](https://github.com/watchexec/clearscreen/actions/workflows/check.yml/badge.svg)](https://github.com/watchexec/clearscreen/actions/workflows/check.yml) -[![Uses Caretaker Maintainership](https://flat.badgen.net/badge/Caretaker/Maintainership%20👥%20/purple)][caretaker] +[![Crate release version](https://badgen.net/crates/v/clearscreen)](https://crates.io/crates/clearscreen) +[![Crate license: Apache 2.0 or MIT](https://badgen.net/badge/license/Apache%202.0%20or%20MIT)][copyright] +![MSRV: 1.51.0 (breaking)](https://badgen.net/badge/MSRV/1.51.0%20%28breaking%29/green) +[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/45671) +[![CI status on main branch](https://github.com/watchexec/clearscreen/actions/workflows/main.yml/badge.svg)](https://github.com/watchexec/clearscreen/actions/workflows/main.yml) # ClearScreen @@ -10,10 +10,8 @@ _Cross-platform terminal screen clearing library._ - **[API documentation][docs]**. - [Dual-licensed][copyright] with Apache 2.0 and MIT. -- Uses [Caretaker Maintainership][caretaker]. - Minimum Supported Rust Version: 1.51.0. -[caretaker]: ./CARETAKERS.md [copyright]: ./COPYRIGHT [docs]: https://docs.rs/clearscreen diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..2f67bb3 --- /dev/null +++ b/bors.toml @@ -0,0 +1,19 @@ +delete_merged_branches = true +update_base_for_deletes = true +use_squash_merge = true + +status = [ + "Test on macos with Rust stable", + "Test on ubuntu with Rust stable", + "Test on windows with Rust stable", + "Test on macos with Rust 1.51.0", + "Test on ubuntu with Rust 1.51.0", + "Test on windows with Rust 1.51.0", +] + +# Disabled until https://github.com/bors-ng/bors-ng/issues/1434 is fixed +#pr_status = [ +# "Clippy on macos", +# "Clippy on ubuntu", +# "Clippy on windows", +#] From 373c363cf79f79bb21b388b5b847493fb1cdcc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 10:48:42 +1200 Subject: [PATCH 2/6] Check windows 10 tests work on msrv --- .github/workflows/check.yml | 12 ++++++++++++ .github/workflows/merge.yml | 17 ++++++++--------- tests/win10/Cargo.toml | 1 - 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ace3b95..3656ab4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -60,3 +60,15 @@ jobs: args: --features windows-console # check to make sure it keeps compiling, but this is unsupported buggy code for now + windows-tests-msrv: + name: Check windows-10 tests compile on MSRV + runs-on: windows-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.51.0 + override: true + - run: cd tests/win10; cargo check diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index b530466..ce1e3ca 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -33,31 +33,30 @@ jobs: profile: minimal toolchain: "${{ matrix.toolchain }}" override: true - - run: rustup component add clippy - uses: actions-rs/cargo@v1 - if: matrix.platform != 'windows' + if: "matrix.platform != 'windows'" with: command: test - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --doc - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed terminfo - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed xterm - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed tput - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed windows_cls # I've absolutely tested the windows_vt things LOCALLY but they DON'T WORK IN CI # I don't know why and at this point I'm very very tired. If you know, help pls. - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed vt_ris - - if: matrix.platform == 'windows' + - if: "matrix.platform == 'windows'" shell: powershell run: cd tests/win10; cargo run diff --git a/tests/win10/Cargo.toml b/tests/win10/Cargo.toml index e1dd4b2..bbc854f 100644 --- a/tests/win10/Cargo.toml +++ b/tests/win10/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "clearscreen-test-win10" version = "0.0.0" -edition = "2021" [dependencies] clearscreen = { path = "../.." } From e4a81f6e1520bd1f5e7a9129d8691be0a5fb12c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 16:58:32 +1200 Subject: [PATCH 3/6] Set toolchain as default to avoid win10 test running on wrong version --- .github/workflows/check.yml | 2 +- .github/workflows/main.yml | 2 +- .github/workflows/merge.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 3656ab4..948138e 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -20,7 +20,7 @@ jobs: with: profile: minimal toolchain: stable - override: true + default: true - run: rustup component add clippy - uses: actions-rs/cargo@v1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5d8014d..3181f70 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: with: profile: minimal toolchain: stable - override: true + default: true - uses: actions-rs/cargo@v1 with: command: check diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index ce1e3ca..5198434 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -32,7 +32,7 @@ jobs: with: profile: minimal toolchain: "${{ matrix.toolchain }}" - override: true + default: true - uses: actions-rs/cargo@v1 if: "matrix.platform != 'windows'" with: From 0b7d560da1aef8e221e0cf92bd3f12f20d634573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 16:58:56 +1200 Subject: [PATCH 4/6] =?UTF-8?q?Don=E2=80=99t=20use=20squash=20merge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bors.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/bors.toml b/bors.toml index 2f67bb3..3fcdf44 100644 --- a/bors.toml +++ b/bors.toml @@ -1,6 +1,5 @@ delete_merged_branches = true update_base_for_deletes = true -use_squash_merge = true status = [ "Test on macos with Rust stable", From 25e79a3a9d765f25e098fe132cff3f8cdf905e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 02:18:47 +1200 Subject: [PATCH 5/6] Explicit version in win10 test --- .github/workflows/merge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 5198434..7495533 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -59,4 +59,4 @@ jobs: run: cargo test --test platformed vt_ris - if: "matrix.platform == 'windows'" shell: powershell - run: cd tests/win10; cargo run + run: cd tests/win10; cargo +${{ matrix.toolchain }} run From e775dbde79af48bfec3f1a5a795c25034469b4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 02:30:00 +1200 Subject: [PATCH 6/6] nope --- .github/workflows/merge.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index 7495533..b5cc09a 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -57,6 +57,8 @@ jobs: - if: "matrix.platform == 'windows'" shell: powershell run: cargo test --test platformed vt_ris - - if: "matrix.platform == 'windows'" + + # remove toolchain restriction when bumping msrv above 1.51 + - if: "matrix.platform == 'windows' && matrix.toolchain == 'stable'" shell: powershell - run: cd tests/win10; cargo +${{ matrix.toolchain }} run + run: cd tests/win10; cargo run