2023-08-19 13:14:01 +00:00
|
|
|
name: Continuous Integration
|
2023-07-17 10:31:31 +00:00
|
|
|
|
2020-12-06 15:46:59 +00:00
|
|
|
on:
|
2023-07-17 10:31:31 +00:00
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
2020-12-06 15:46:59 +00:00
|
|
|
push:
|
|
|
|
branches:
|
2023-03-01 10:06:14 +00:00
|
|
|
- main
|
2020-12-06 15:46:59 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
2023-03-01 10:06:14 +00:00
|
|
|
- main
|
2023-06-11 20:28:17 +00:00
|
|
|
merge_group:
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
# ensure that the workflow is only triggered once per PR, subsequent pushes to the PR will cancel
|
|
|
|
# and restart the workflow. See https://docs.github.com/en/actions/using-jobs/using-concurrency
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
2019-11-05 07:24:14 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
env:
|
|
|
|
# don't install husky hooks during CI as they are only needed for for pre-push
|
|
|
|
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
|
2019-11-05 07:24:14 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
# lint, clippy and coveraget jobs are intentionally early in the workflow to catch simple
|
|
|
|
# formatting, typos, and missing tests as early as possible. This allows us to fix these and
|
|
|
|
# resubmit the PR without having to wait for the comprehensive matrix of tests to complete.
|
2019-11-05 07:24:14 +00:00
|
|
|
jobs:
|
2023-07-17 10:31:31 +00:00
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
2023-06-26 07:31:30 +00:00
|
|
|
steps:
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Checkout
|
|
|
|
if: github.event_name != 'pull_request'
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Checkout
|
|
|
|
if: github.event_name == 'pull_request'
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-06-26 07:31:30 +00:00
|
|
|
with:
|
2023-07-17 10:31:31 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Install Rust nightly
|
|
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
|
|
with:
|
|
|
|
components: rustfmt
|
2023-06-26 07:31:30 +00:00
|
|
|
- name: Install cargo-make
|
|
|
|
uses: taiki-e/install-action@cargo-make
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Check formatting
|
2023-09-05 07:48:36 +00:00
|
|
|
run: cargo make lint-format
|
2023-09-02 02:59:07 +00:00
|
|
|
- name: Check documentation
|
2023-09-05 07:48:36 +00:00
|
|
|
run: cargo make lint-docs
|
2023-09-02 23:30:00 +00:00
|
|
|
- name: Check conventional commits
|
|
|
|
uses: crate-ci/committed@master
|
|
|
|
with:
|
|
|
|
args: "-vv"
|
|
|
|
commits: HEAD
|
|
|
|
- name: Check typos
|
|
|
|
uses: crate-ci/typos@master
|
|
|
|
- name: Lint dependencies
|
|
|
|
uses: EmbarkStudios/cargo-deny-action@v1
|
2023-06-26 07:31:30 +00:00
|
|
|
|
|
|
|
clippy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Checkout
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Install Rust stable
|
2023-06-26 07:31:30 +00:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
components: clippy
|
|
|
|
- name: Install cargo-make
|
|
|
|
uses: taiki-e/install-action@cargo-make
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Run cargo make clippy-all
|
2023-06-26 07:31:30 +00:00
|
|
|
run: cargo make clippy
|
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
coverage:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Install Rust stable
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
with:
|
|
|
|
components: llvm-tools
|
|
|
|
- name: Install cargo-llvm-cov and cargo-make
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: cargo-llvm-cov,cargo-make
|
|
|
|
- name: Generate coverage
|
|
|
|
run: cargo make coverage
|
|
|
|
- name: Upload to codecov.io
|
|
|
|
uses: codecov/codecov-action@v3
|
|
|
|
with:
|
2023-07-28 06:57:53 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2023-07-17 10:31:31 +00:00
|
|
|
fail_ci_if_error: true
|
|
|
|
|
|
|
|
check:
|
2020-08-02 14:17:57 +00:00
|
|
|
strategy:
|
2023-08-04 09:56:05 +00:00
|
|
|
fail-fast: false
|
2020-08-02 14:17:57 +00:00
|
|
|
matrix:
|
2023-06-11 20:28:17 +00:00
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
2023-10-25 09:44:36 +00:00
|
|
|
toolchain: [ "1.70.0", "stable" ]
|
2023-02-17 11:59:18 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-11-05 07:24:14 +00:00
|
|
|
steps:
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Checkout
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Install Rust {{ matrix.toolchain }}
|
2023-06-12 23:25:18 +00:00
|
|
|
uses: dtolnay/rust-toolchain@master
|
2020-12-06 17:31:54 +00:00
|
|
|
with:
|
2023-06-12 23:25:18 +00:00
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
- name: Install cargo-make
|
2023-06-26 07:31:30 +00:00
|
|
|
uses: taiki-e/install-action@cargo-make
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Run cargo make check
|
|
|
|
run: cargo make check
|
2020-08-02 16:30:52 +00:00
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
2023-02-25 13:36:49 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
test-doc:
|
|
|
|
strategy:
|
2023-08-04 09:56:05 +00:00
|
|
|
fail-fast: false
|
2023-07-17 10:31:31 +00:00
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
|
|
|
runs-on: ${{ matrix.os }}
|
2023-02-25 13:36:49 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Install Rust stable
|
|
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install cargo-make
|
|
|
|
uses: taiki-e/install-action@cargo-make
|
|
|
|
- name: Test docs
|
|
|
|
run: cargo make test-doc
|
|
|
|
env:
|
|
|
|
RUST_BACKTRACE: full
|
2023-06-01 11:21:16 +00:00
|
|
|
|
2023-07-17 10:31:31 +00:00
|
|
|
test:
|
|
|
|
strategy:
|
2023-08-04 09:56:05 +00:00
|
|
|
fail-fast: false
|
2023-07-17 10:31:31 +00:00
|
|
|
matrix:
|
|
|
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
2023-10-25 09:44:36 +00:00
|
|
|
toolchain: [ "1.70.0", "stable" ]
|
2023-07-17 10:31:31 +00:00
|
|
|
backend: [ crossterm, termion, termwiz ]
|
|
|
|
exclude:
|
|
|
|
# termion is not supported on windows
|
|
|
|
- os: windows-latest
|
|
|
|
backend: termion
|
|
|
|
runs-on: ${{ matrix.os }}
|
2023-06-01 11:21:16 +00:00
|
|
|
steps:
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Checkout
|
2023-10-21 10:19:52 +00:00
|
|
|
uses: actions/checkout@v4
|
2023-07-17 10:31:31 +00:00
|
|
|
- name: Install Rust ${{ matrix.toolchain }}}
|
|
|
|
uses: dtolnay/rust-toolchain@master
|
2023-06-01 11:21:16 +00:00
|
|
|
with:
|
2023-07-17 10:31:31 +00:00
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
- name: Install cargo-make
|
|
|
|
uses: taiki-e/install-action@cargo-make
|
|
|
|
- name: Test ${{ matrix.backend }}
|
|
|
|
run: cargo make test-backend ${{ matrix.backend }}
|
2023-06-24 06:03:31 +00:00
|
|
|
env:
|
2023-07-17 10:31:31 +00:00
|
|
|
RUST_BACKTRACE: full
|