Skip to content

Commit

Permalink
Merge pull request #13 from saying121/dev
Browse files Browse the repository at this point in the history
perf: avoid unnecessary render and filter
chore: udpate ratatui to 0.26.3
  • Loading branch information
saying121 authored May 24, 2024
2 parents 8b844c1 + 1b648aa commit a843b2f
Show file tree
Hide file tree
Showing 57 changed files with 1,848 additions and 1,366 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/aur.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
aur-publish:
runs-on: ubuntu-latest
environment: aur
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Fetch Repository
Expand All @@ -29,9 +30,9 @@ jobs:
sha_x86_64=$(cut -d' ' -f1 <(cat x86_64.txt))
sha_aarch64=$(cut -d' ' -f1 <(cat aarch64.txt))
sed -i "s/^pkgver=.*/pkgver=$GITHUB_REF_NAME/g" ./aur/PKGBUILD
sed -i "s/^sha256sums_x86_64=.*/sha256sums_x86_64=\(\'$sha_x86_64\'\)/g" ./aur/PKGBUILD
sed -i "s/^sha256sums_aarch64=.*/sha256sums_aarch64=\(\'$sha_aarch64\'\)/g" ./aur/PKGBUILD
sed -i "s/^pkgver=.*/pkgver=$GITHUB_REF_NAME/g" ./aur/PKGBUILD
- name: Publish AUR lcode
uses: KSXGitHub/github-actions-deploy-aur@v2
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Clippy

on: [push, pull_request, merge_group]
on:
push:

env:
RUST_BACKTRACE: 1
Expand All @@ -25,6 +26,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}

- name: Install Dbus
Expand All @@ -39,5 +41,10 @@ jobs:
toolchain: nightly
components: clippy

- name: Run clippy
run: cargo clippy
- name: Run Clippy Allow Warning
if: ${{ ! (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') }}
run: cargo clippy --locked

- name: Run Clippy Deny Warning
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
run: cargo clippy --locked -- -D warnings
1 change: 1 addition & 0 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-fmt-${{ hashFiles('**/Cargo.lock') }}

- uses: dtolnay/rust-toolchain@master
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}

- name: Install Nightly Rust Toolchain
Expand All @@ -42,7 +43,7 @@ jobs:
tool: cargo-binstall

- name: Install cargo-release
run: cargo binstall -y cargo-release
run: cargo binstall -y --locked cargo-release

- name: Install Dbus
run: sudo apt update && sudo apt install libdbus-1-dev pkg-config
Expand Down Expand Up @@ -84,6 +85,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install Nightly Rust Toolchain
Expand Down Expand Up @@ -175,6 +177,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install Dbus
Expand Down
47 changes: 9 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,15 @@
name: Test

on: [pull_request, merge_group]
on:
push:
branches:
- "main"
pull_request:

env:
RUST_BACKTRACE: 1

jobs:
clippy:
name: Clippy rust
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [nightly]
steps:
- uses: actions/checkout/@v4

- name: Cargo Cache
id: cargo-cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-test-clippy-${{ hashFiles('**/Cargo.lock') }}

- name: Install Dbus
if: startsWith(matrix.os, 'ubuntu-')
run: |
sudo apt update
sudo apt install -y libdbus-1-dev pkg-config
- name: Install Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: clippy

- name: Run clippy
run: cargo clippy -- -D warnings

test:
name: Test
runs-on: ${{ matrix.os }}
Expand All @@ -64,6 +32,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Windows Cache leetcode
Expand All @@ -77,6 +46,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Macos Cache leetcode
Expand All @@ -90,6 +60,7 @@ jobs:
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Rust Toolchain
Expand All @@ -111,4 +82,4 @@ jobs:
- name: Run Test
run: |
# cargo nextest run get_all_pbs_works new_get_index # generate database
cargo nextest run
cargo nextest run --locked
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Perf

- avoid unnecessary render and filter.

## [0.9.1] - 2024-05-18

### Fixed
Expand Down
Loading

0 comments on commit a843b2f

Please sign in to comment.