From a515b06bcb556c1be2d0fc3095cd778d413fe40d Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Fri, 31 Mar 2023 22:57:37 +0100 Subject: Vendor ratatui temporarily (#835) * Vendor ratatui temporarily Once https://github.com/tui-rs-revival/ratatui/pull/114 has been merged, we can undo this! But otherwise we can't publish to crates.io with a git dependency. * make tests pass * Shush. * these literally just fail in nix, nowhere else idk how to work with nix properly, and they're also not our tests --- src/ratatui/.github/ISSUE_TEMPLATE/bug_report.md | 60 +++++++++++++++++ src/ratatui/.github/ISSUE_TEMPLATE/config.yml | 1 + .../.github/ISSUE_TEMPLATE/feature_request.md | 32 +++++++++ src/ratatui/.github/workflows/cd.yml | 19 ++++++ src/ratatui/.github/workflows/ci.yml | 76 ++++++++++++++++++++++ 5 files changed, 188 insertions(+) create mode 100644 src/ratatui/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 src/ratatui/.github/ISSUE_TEMPLATE/config.yml create mode 100644 src/ratatui/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 src/ratatui/.github/workflows/cd.yml create mode 100644 src/ratatui/.github/workflows/ci.yml (limited to 'src/ratatui/.github') diff --git a/src/ratatui/.github/ISSUE_TEMPLATE/bug_report.md b/src/ratatui/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..0a0f4bc6 --- /dev/null +++ b/src/ratatui/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,60 @@ +--- +name: Bug report +about: Create an issue about a bug you encountered +title: '' +labels: bug +assignees: '' +--- + + + +## Description + + + +## To Reproduce + + + +## Expected behavior + + + +## Screenshots + + + +## Environment + + +- OS: +- Terminal Emulator: +- Font: +- Crate version: +- Backend: + +## Additional context + diff --git a/src/ratatui/.github/ISSUE_TEMPLATE/config.yml b/src/ratatui/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..3ba13e0c --- /dev/null +++ b/src/ratatui/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false diff --git a/src/ratatui/.github/ISSUE_TEMPLATE/feature_request.md b/src/ratatui/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..ae095edb --- /dev/null +++ b/src/ratatui/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,32 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +## Problem + + +## Solution + + +## Alternatives + + +## Additional context + diff --git a/src/ratatui/.github/workflows/cd.yml b/src/ratatui/.github/workflows/cd.yml new file mode 100644 index 00000000..f61e3603 --- /dev/null +++ b/src/ratatui/.github/workflows/cd.yml @@ -0,0 +1,19 @@ +name: Continuous Deployment + +on: + push: + tags: + - "v*.*.*" + +jobs: + publish: + name: Publish on crates.io + runs-on: ubuntu-latest + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + - name: Publish + uses: actions-rs/cargo@v1 + with: + command: publish + args: --token ${{ secrets.CARGO_TOKEN }} diff --git a/src/ratatui/.github/workflows/ci.yml b/src/ratatui/.github/workflows/ci.yml new file mode 100644 index 00000000..bfa363e9 --- /dev/null +++ b/src/ratatui/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + +name: CI + +env: + CI_CARGO_MAKE_VERSION: 0.35.16 + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + rust: ["1.59.0", "stable"] + include: + - os: ubuntu-latest + triple: x86_64-unknown-linux-musl + - os: windows-latest + triple: x86_64-pc-windows-msvc + - os: macos-latest + triple: x86_64-apple-darwin + runs-on: ${{ matrix.os }} + steps: + - uses: hecrj/setup-rust-action@50a120e4d34903c2c1383dec0e9b1d349a9cc2b1 + with: + rust-version: ${{ matrix.rust }} + components: rustfmt,clippy + - uses: actions/checkout@v3 + - name: Install cargo-make on Linux or macOS + if: ${{ runner.os != 'windows' }} + shell: bash + run: | + curl -LO 'https://github.com/sagiegurari/cargo-make/releases/download/${{ env.CI_CARGO_MAKE_VERSION }}/cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + unzip 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + cp 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}/cargo-make' ~/.cargo/bin/ + cargo make --version + - name: Install cargo-make on Windows + if: ${{ runner.os == 'windows' }} + shell: bash + run: | + # `cargo-make-v0.35.16-{target}/` directory is created on Linux and macOS, but it is not creatd on Windows. + mkdir cargo-make-temporary + cd cargo-make-temporary + curl -LO 'https://github.com/sagiegurari/cargo-make/releases/download/${{ env.CI_CARGO_MAKE_VERSION }}/cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + unzip 'cargo-make-v${{ env.CI_CARGO_MAKE_VERSION }}-${{ matrix.triple }}.zip' + cp cargo-make.exe ~/.cargo/bin/ + cd .. + cargo make --version + - name: "Format / Build / Test" + run: cargo make ci + env: + RUST_BACKTRACE: full + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + if: github.event_name != 'pull_request' + uses: actions/checkout@v3 + - name: Checkout + if: github.event_name == 'pull_request' + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: "Check conventional commits" + uses: crate-ci/committed@master + with: + args: "-vv" + commits: "HEAD" + - name: "Check typos" + uses: crate-ci/typos@master -- cgit v1.3.1