Skip to content

Commit 6c1d184

Browse files
authored
Add a CI check for PRs (#360)
Closes #339
1 parent a82483d commit 6c1d184

4 files changed

Lines changed: 45 additions & 8 deletions

File tree

.github/workflows/pr.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: PR Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
check:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- windows-latest
19+
steps:
20+
# The Windows runners have autocrlf enabled by default.
21+
- name: Disable git autocrlf
22+
run: git config --global core.autocrlf false
23+
if: matrix.os == 'windows-latest'
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
27+
# Depends on `Cargo.lock` --> Has to be after checkout.
28+
- uses: actions/cache@v4
29+
with:
30+
path: |
31+
~/.cargo/bin/
32+
~/.cargo/registry/index/
33+
~/.cargo/registry/cache/
34+
~/.cargo/git/db/
35+
target/
36+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
37+
- name: Install Rust
38+
run: rustup toolchain install nightly --no-self-update --profile minimal --component rust-src,rustfmt,clippy
39+
- name: Check formatting
40+
run: cargo fmt --all -- --check
41+
- name: Run tests
42+
run: cargo test --all-features --all-targets
43+
- name: Run clippy
44+
run: cargo clippy --all-features --all-targets -- --deny warnings

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ name = "lib"
1212
harness = false
1313

1414
[features]
15-
debug-layout = []
1615
debug-latency = []
1716

1817
# We use `opt-level = "s"` as it significantly reduces binary size.

src/bin/edit/draw_statusbar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub fn draw_statusbar(ctx: &mut Context, state: &mut State) {
155155
),
156156
);
157157

158-
#[cfg(any(feature = "debug-layout", feature = "debug-latency"))]
158+
#[cfg(feature = "debug-latency")]
159159
ctx.label(
160160
"stats",
161161
&arena_format!(ctx.arena(), "{}/{}", tb.logical_line_count(), tb.visual_line_count(),),

src/bin/edit/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,6 @@ fn run() -> apperr::Result<()> {
158158

159159
draw(&mut ctx, &mut state);
160160

161-
#[cfg(feature = "debug-layout")]
162-
{
163-
drop(ctx);
164-
state.buffer.buffer.copy_from_str(&tui.debug_layout());
165-
}
166-
167161
#[cfg(feature = "debug-latency")]
168162
{
169163
passes += 1;

0 commit comments

Comments
 (0)