Skip to content

Commit

Permalink
Merge pull request #14 from saying121/dev
Browse files Browse the repository at this point in the history
leetcode-api: add `add_last_test_case`
  • Loading branch information
saying121 authored May 28, 2024
2 parents 00c02bf + c5beb22 commit caf3d95
Show file tree
Hide file tree
Showing 31 changed files with 246 additions and 219 deletions.
23 changes: 7 additions & 16 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,21 @@ jobs:
steps:
- uses: actions/checkout/@v4

- name: Cargo Cache
id: cargo-cache
uses: actions/cache@v4
- name: Install Toolchain
uses: dtolnay/rust-toolchain@master
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-clippy-${{ hashFiles('**/Cargo.lock') }}
toolchain: nightly
components: clippy

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- 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 Allow Warning
if: ${{ ! (github.ref == 'refs/heads/main' || github.event_name == 'pull_request') }}
run: cargo clippy --locked
Expand Down
12 changes: 0 additions & 12 deletions .github/workflows/fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ jobs:
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/
target/
key: ${{ runner.os }}-fmt-${{ hashFiles('**/Cargo.lock') }}

- uses: dtolnay/rust-toolchain@master
with:
# my rustfmt config use many nightly features
Expand Down
58 changes: 19 additions & 39 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,19 @@ jobs:
- name: Fetch Repository
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/
target/
key: ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}

- name: Install Nightly Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly

- name: Rust version
id: rustc-version
run: |
echo "rustc=$(rustc --version)" >> "$GITHUB_OUTPUT"
- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install cargo-binstall
uses: taiki-e/install-action@v2
with:
Expand Down Expand Up @@ -76,17 +72,9 @@ jobs:
- name: Fetch Repository
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/
target/
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install Nightly Rust Toolchain
uses: dtolnay/rust-toolchain@master
Expand Down Expand Up @@ -168,28 +156,19 @@ jobs:
- name: Checkout
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/
target/
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}

- name: Install Dbus
if: ${{ !matrix.cross && startsWith(matrix.os, 'ubuntu-') }}
run: sudo apt update && sudo apt install libdbus-1-dev pkg-config

- name: Install Nightly Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.target }}

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install Dbus
if: ${{ !matrix.cross && startsWith(matrix.os, 'ubuntu-') }}
run: sudo apt update && sudo apt install libdbus-1-dev pkg-config

- name: Install cross-compilation tools
if: ${{ matrix.cross }}
uses: taiki-e/setup-cross-toolchain-action@v1
Expand Down Expand Up @@ -226,6 +205,7 @@ jobs:
url="https://github.com/saying121/lcode/releases/download/%s/lcode-%s-%s-unknown-linux-gnu.sha256"
tag=$GITHUB_REF_NAME
# shellcheck disable=SC2059
x86_url=$(printf $url "$tag" "$tag" x86_64)
wget -O x86_64.txt "$x86_url"
Expand Down
52 changes: 14 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,52 +21,28 @@ jobs:
steps:
- uses: actions/checkout/@v4

- name: Linux Cache leetcode
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly

- name: Rust Cache
if: startsWith(matrix.os, 'ubuntu-')
id: linux-leetcode-cache
uses: actions/cache@v4
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cache/lcode/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}
cache-directories: "~/.cache/lcode/"

- name: Windows Cache leetcode
- name: Rust Cache
if: startsWith(matrix.os, 'windows-')
id: windows-leetcode-cache
uses: actions/cache@v4
uses: Swatinem/rust-cache@v2
with:
path: |
~/AppData/Local/lcode/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}
cache-directories: "~/AppData/Local/lcode/"

- name: Macos Cache leetcode
- name: Rust Cache
if: startsWith(matrix.os, 'macos-')
id: macos-leetcode-cache
uses: actions/cache@v4
uses: Swatinem/rust-cache@v2
with:
path: |
~/Library/Caches/lcode/
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-test-${{ hashFiles('**/Cargo.lock') }}

- name: Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
cache-directories: "~/Library/Caches/lcode/"

- name: Install Dependencies
if: startsWith(matrix.os, 'ubuntu-')
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- leetcode-api: add api `add_last_test_case`.

### Perf

- avoid unnecessary render and filter.
Expand Down
34 changes: 16 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ session = ""

- If neither of the above two items is filled in,
and then use this order
_Firefox_ -> _Librewolf_ -> _Chrome_ -> _Edge_ -> _Chromium_
-> _Brave_ -> _Yandex_ -> _Vivaldi_ -> _Opera_ -> _OperaGX_ -> _CocCoc_
_`Firefox`_ -> _`Librewolf`_ -> _`Chrome`_ -> _`Edge`_ -> _`Chromium`_
-> _`Brave`_ -> _`Yandex`_ -> _`Vivaldi`_ -> _`Opera`_ -> _`OperaGX`_ -> _`CocCoc`_
try to get cookies.

### Keymap
Expand Down
2 changes: 0 additions & 2 deletions crates/lcode-config/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(lazy_cell)]

pub mod config;
pub mod global;
pub mod keymap;
Expand Down
1 change: 1 addition & 0 deletions crates/lcode/README.md
Loading

0 comments on commit caf3d95

Please sign in to comment.