diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8bb6408 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,14 @@ +# Dependabot dependency version checks / updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` + directory: "/" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml deleted file mode 100644 index 8fd8458..0000000 --- a/.github/workflows/audit.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Security audit -on: - schedule: - - cron: '0 0 * * *' -jobs: - audit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index 948138e..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: PR feedback -on: - pull_request: - -jobs: - clippy: - strategy: - matrix: - include: - - platform: macos - - platform: ubuntu - - platform: windows - - name: Clippy on ${{ matrix.platform }} - runs-on: "${{ matrix.platform }}-latest" - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - default: true - - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - - 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: fmt - args: --check - - windows-console: - name: Check windows-console feature compiles - runs-on: windows-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 - 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/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 3181f70..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,28 +0,0 @@ -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 - default: true - - uses: actions-rs/cargo@v1 - with: - command: check diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml deleted file mode 100644 index b5cc09a..0000000 --- a/.github/workflows/merge.yml +++ /dev/null @@ -1,64 +0,0 @@ -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 }}" - default: true - - 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 - - # remove toolchain restriction when bumping msrv above 1.51 - - if: "matrix.platform == 'windows' && matrix.toolchain == 'stable'" - shell: powershell - run: cd tests/win10; cargo run diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..c6b7f0d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,58 @@ +name: Tests +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +jobs: + check: + strategy: + matrix: + platform: + - macos + - ubuntu + - windows + toolchain: + - stable + - 1.60.0 + + name: Test on ${{ matrix.platform }} with Rust ${{ matrix.toolchain }} + runs-on: "${{ matrix.platform }}-latest" + + steps: + - uses: actions/checkout@v3 + + - name: Configure toolchain + run: | + rustup toolchain install --profile minimal --no-self-update ${{ matrix.toolchain }} + rustup default ${{ matrix.toolchain }} + + - if: "matrix.platform != 'windows'" + run: cargo test + + # the enumeration of tests is because windows_vt tests don't work in CI somehow + # the Invoke-NativeCommand thing is because powershell is fucking insane + # ref: https://stackoverflow.com/questions/11450153/powershell-analogue-of-bashs-set-e + - if: "matrix.platform == 'windows'" + shell: powershell + run: | + function Invoke-NativeCommand { + $command = $args[0] + $arguments = $args[1..($args.Length)] + & $command @arguments + if ($LastExitCode -ne 0) { + Write-Error "Exit code $LastExitCode while running $command $arguments" + } + } + + Invoke-NativeCommand cargo test --doc + Invoke-NativeCommand cargo test --test platformed terminfo + Invoke-NativeCommand cargo test --test platformed xterm + Invoke-NativeCommand cargo test --test platformed tput + Invoke-NativeCommand cargo test --test platformed windows_cls + Invoke-NativeCommand cargo test --test platformed vt_ris + + cd tests/win10 + Invoke-NativeCommand cargo run diff --git a/CHANGELOG.md b/CHANGELOG.md index a2d6896..646e6bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Next (YYYY-MM-DD) +- Don't use BORS. +- Update dependencies. +- Update to nix 0.26. +- Change MSRV policy to stable-5 supported, and bump MSRV to 1.60.0. + ## v1.0.10 (2022-06-01) - Use BORS. diff --git a/Cargo.toml b/Cargo.toml index e9ac28b..ec59b46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,19 +12,20 @@ homepage = "https://github.com/watchexec/clearscreen" repository = "https://github.com/watchexec/clearscreen" readme = "README.md" -edition = "2018" +edition = "2021" exclude = ["/bin", "/.github"] +rust-version = "1.60.0" [features] windows-console = [] [dependencies] terminfo = "0.7.3" -thiserror = "1.0.24" -which = "4.1.0" +thiserror = "1.0.38" +which = "4.3.0" [target.'cfg(unix)'.dependencies.nix] -version = "0.24.1" +version = "0.26.1" default-features = false features = ["fs", "term"] diff --git a/README.md b/README.md index 0f775ba..6b2c4fe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![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) +[![CI status on main branch](https://github.com/watchexec/clearscreen/actions/workflows/tests.yml/badge.svg)](https://github.com/watchexec/clearscreen/actions/workflows/main.yml) # ClearScreen @@ -10,7 +8,9 @@ _Cross-platform terminal screen clearing library._ - **[API documentation][docs]**. - [Dual-licensed][copyright] with Apache 2.0 and MIT. -- Minimum Supported Rust Version: 1.51.0. +- Minimum Supported Rust Version: 1.60.0. + - Only the last five stable versions are supported. + - MSRV increases beyond that range at publish time will not incur major version bumps. [copyright]: ./COPYRIGHT [docs]: https://docs.rs/clearscreen diff --git a/bin/version b/bin/version index b3417b1..2870222 100755 --- a/bin/version +++ b/bin/version @@ -51,7 +51,7 @@ cargo check git commit -am "$newver" -echo "Pushing to upstream, make a PR for Bors then release with GH" +echo "Pushing to upstream, make a PR then release with GH" git push -u $upstream release echo "Deleting local release branch" diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 3fcdf44..0000000 --- a/bors.toml +++ /dev/null @@ -1,18 +0,0 @@ -delete_merged_branches = true -update_base_for_deletes = 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", -#]