mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2024-11-05 21:28:48 +00:00
Merge pull request #56 from adamperkowski/CI
CI: Add lint checks & change actions-rs/toolchain to dtolnay/rust-toolchain
This commit is contained in:
commit
0883aa5c98
6
.github/workflows/linutil.yml
vendored
6
.github/workflows/linutil.yml
vendored
|
@ -30,13 +30,11 @@ jobs:
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-cargo-index-
|
restore-keys: ${{ runner.os }}-cargo-index-
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo build --target-dir=build --release --verbose
|
run: cargo build --target-dir=build --release --verbose
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v5
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: Commit Linutil
|
commit_message: Commit Linutil
|
||||||
file_pattern: 'build/release/linutil'
|
file_pattern: 'build/release/linutil'
|
||||||
if: success()
|
if: success()
|
||||||
|
|
33
.github/workflows/rust.yml
vendored
33
.github/workflows/rust.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Rust Check
|
name: Rust Checks
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -9,25 +9,46 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
cargo_check:
|
cargo_check:
|
||||||
|
name: Cargo Check
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache Cargo registry
|
- name: Cache Cargo registry
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-cargo-registry-
|
restore-keys: ${{ runner.os }}-cargo-registry-
|
||||||
|
|
||||||
- name: Cache Cargo index
|
- name: Cache Cargo index
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/git
|
path: ~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-cargo-index-
|
restore-keys: ${{ runner.os }}-cargo-index-
|
||||||
|
|
||||||
- name: Install Rust
|
- name: Install Rust
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cargo check
|
run: cargo check
|
||||||
|
|
||||||
|
lints:
|
||||||
|
name: Lints
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- name: Run cargo fmt
|
||||||
|
run: cargo fmt --all --check
|
||||||
|
|
||||||
|
- name: Run cargo clippy
|
||||||
|
run: cargo clippy
|
||||||
|
|
Loading…
Reference in New Issue
Block a user